Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Switch Module on Perl 5.8.0

by herveus (Parson)
on Oct 14, 2011 at 18:11 UTC ( #931567=note: print w/ replies, xml ) Need Help??


in reply to Switch Module on Perl 5.8.0

Howdy!

Switch is a source filter, so that comes with extra-crunchy behavior at times. I'm not up on the fine details of where it will bite you, but that may be the case. What do you get from Deparse when you comment out "use Switch", etc.? The results you show certainly raise eyebrows.

yours,
Michael


Comment on Re: Switch Module on Perl 5.8.0
Re^2: Switch Module on Perl 5.8.0
by bichonfrise74 (Vicar) on Oct 14, 2011 at 18:35 UTC
    This is the output from Deparse when the 'use Switch' is commented out.
    die "Error: $!" unless open my $fh, '<', '/tmp/test_file.txt'; while (defined(my $line = <$fh> )) { print "$line\n"; } close $fh;
    When I saw this, I thought maybe the Switch module was adding the File::Glob statement but when I scanned the Switch module, I didn't immediately see why it would even do such a thing.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://931567]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-09-22 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (188 votes), past polls