मेरा लक्ष्य नीचे sample.pl
स्क्रिप्ट डीबग (चरण-दर-चरण) है।मैं पर्ल ट्रेस से चर के मान कैसे देख सकता हूं?
समस्या: मुझे चर के वास्तविक मूल्य ($ top_number, $ x, $ कुल) नहीं मिलते हैं।
मेरा प्रश्न: ट्रेस आउटपुट से के वास्तविक पूर्णांक मानों को कैसे देखें?
संख्या प्राप्त करने के लिए perl -d:Trace
में बदलने की क्या ज़रूरत है, और नहीं: $ top_number, $ x, $ कुल? ट्रेस उत्पादन से
उदाहरण:
[[email protected] /tmp]# perl -d:Trace ./sample.pl
>> ./sampl.pl:9: $top_number = 100;
>> ./sampl.pl:10: $x = 1;
>> ./sampl.pl:11: $total = 0;
>> ./sampl.pl:12: while ($x <= $top_number) {
>> ./sampl.pl:13: $total = $total + $x; # short form: $total += $x;
>> ./sampl.pl:14: $x += 1; # do you follow this short form?
>> ./sampl.pl:13: $total = $total + $x; # short form: $total += $x;
>> ./sampl.pl:14: $x += 1; # do you follow this short form?
>> ./sampl.pl:13: $total = $total + $x; # short form: $total += $x;
>> ./sampl.pl:14: $x += 1; # do you follow this short form?
.
.
[[email protected] /tmp]#more sample.pl script
#!/usr/bin/perl
$top_number = 100;
$x = 1;
$total = 0;
while ($x <= $top_number) {
$total = $total + $x; # short form: $total += $x;
$x += 1; # do you follow this short form?
}
print "The total from 1 to $top_number is $total\n";
'डेवेल :: डंपट्रेस' कुछ दिन पहले जारी किया गया था। सभ्य रहें और आपको मिलने वाली किसी भी बग की रिपोर्ट करें। :-) – mob
@Mob चिंता न करें मैं – jon
@ हाय फिर से मुझे त्रुटि मिल जाएगी: perl -d: DumpTrace ./sampl.pl @INC में PadWalker.pm का पता नहीं लगा सकता? क्यों – jon