develooper Front page | perl.perl5.porters | Postings from May 2013

RE: Bug with Switch.pm?

Thread Previous | Thread Next
From:
Dave Landis
Date:
May 11, 2013 08:53
Subject:
RE: Bug with Switch.pm?
Message ID:
88E1C38078F2B945B53193E5993D63744D316035F1@SC-VEXCH4.marvell.com
P.S.  I'm using Perl 5.8.7 on a Linux platform.


From: Dave Landis
Sent: Wednesday, May 08, 2013 3:03 PM
To: 'rgarciasuarez@gmail.com'; 'perl5-porters@perl.org'
Subject: Bug with Switch.pm?

Hello, Rafael and others.

Thank you for your work with the Switch.pm model.

I just implemented some code using Switch.pm and was happy with the result.

Later. with that same code, I wanted to read data using the <DATA> filehandle, but wasn't able to.

After removing "use" lines one-by-one, I came to the conclusion that the Switch.pm was disabling my ability to use  the <DATA> file handle.

Please see the following code snippets:
------------------THIS CODE WORKS AS EXPECTED ----
#! /usr/bin/perl -w

@lines = <DATA>;

foreach (@lines) {
    print $_;
}

__END__
This is line 1.
This is line 2.
This is line 3.

------  This code does not work as expected ----------------------------------
#! /usr/bin/perl -w

use Switch;

@lines = <DATA>;

foreach (@lines) {
    print $_;
}

__END__
This is line 1.
This is line 2.
This is line 3.
----
Best regards,
Dave Landis


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About