I
Ian Pellew
Hi all;
What does the
1;
line of a perl script do?
Regards
Ian
What does the
1;
line of a perl script do?
Regards
Ian
What does the
1;
line of a perl script do?
What does the
1;
line of a perl script do?
Ian said:Hi all;
What does the
1;
line of a perl script do?
Ian Pellew said:What does the
1;
line of a perl script do?
nothing....it generates code, but serves no purpose....it is the smallest
and simplest progrma you could write....
not sure under what context you came across that line of code, but other
that the use below, i know of no other purpose it would be used for...."as
you typed it"
perl -MNet:OP3 -e 1
daniel said:it generates code, but serves no purpose
daniel said:am new to perl, but shoudln't that be done wiht an exit()?
daniel said:or with a return as well?
KKramsch said:The use of 1 (or any other Perl true value)[..]
The reason is that when I run a program in the Perl
debugger quite often it happens that even when I issue a debugger
command such as "c 50" the debugger will advance the program up to
line 50, but instead of stopping, it executes line 50 and proceeds
past it without stopping. I've never understood why this is, but
I've found that if I insert a line such as
1;
right before (the former) line 50, then "c 50" does bring the
program up to line 50 (i.e. the new "1;" line) and no further, as
desired. Klugey and clueless but functional. If there's a more
civilized way to deal with this situation I'd love to hear about
it.
Karl
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.