Re: step over or ignore function in Perl?!
by apl (Monsignor) on May 06, 2009 at 12:24 UTC
|
; # ignore this really cool Perl statement | [reply] [d/l] |
Re: step over or ignore function in Perl?!
by AnomalousMonk (Archbishop) on May 06, 2009 at 14:24 UTC
|
>perl -wMstrict -le
"my $this_is_true = rand > 0.5;
do_this_function() if $this_is_true;
print q{i'm doing that!} while rand > 0.5;
sub do_this_function { print q{i'm doing this!} }
"
i'm doing this!
i'm doing that!
i'm doing that!
Update: New, improved example! Now with more modifiers! | [reply] [d/l] |
Re: step over or ignore function in Perl?!
by targetsmart (Curate) on May 06, 2009 at 12:29 UTC
|
You mean goto, next ??
Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.
| [reply] |
Re: step over or ignore function in Perl?!
by Anonymous Monk on May 06, 2009 at 12:10 UTC
|
Please name some of these languages ... or are you thinking of
perl5db.pl - the perl debugger | [reply] |
|
|
Python has 'pass', Bourne/Korn/Bash has ':', COBOL has (had?) NEXT-SENTENCE. But they were needed in those languages because (generally) of a lack of block delimiters, you shouldn't really need it in Perl. You can just have an empty block:
use strict;
use warnings;
my $x;
if (defined $x) {
# do nothing
}
else {
print "\$x is not defined\n"
}
| [reply] [d/l] |
Re: step over or ignore function in Perl?!
by gemoroy (Beadle) on May 06, 2009 at 14:48 UTC
|
If you still had in view perl debugger, you can use man perldebug, and find out there that you should use n or "next"
to step over fucntion. | [reply] |
Re: step over or ignore function in Perl?!
by gemoroy (Beadle) on May 06, 2009 at 12:22 UTC
|
Maybe you mean deferred compilation of sub func's? | [reply] |
Re: step over or ignore function in Perl?!
by planetscape (Chancellor) on May 07, 2009 at 03:26 UTC
|
| [reply] |
Re: step over or ignore function in Perl?!
by codeacrobat (Chaplain) on May 06, 2009 at 22:33 UTC
|
Are you looking for Acme::Don't ?
print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});
| [reply] [d/l] |
Re: step over or ignore function in Perl?!
by talexb (Chancellor) on May 07, 2009 at 00:30 UTC
|
Do you mean when you're in the debugger, and you want to step over a line that you know you don't want to run?
If that's the case, no.
Alex / talexb / Toronto
"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds
| [reply] |