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

<DATA> file handle not working with Perl Starwbery 5.12.1

by sufi (Initiate)
on Dec 23, 2010 at 05:07 UTC ( [id://878727]=perlquestion: print w/replies, xml ) Need Help??

sufi has asked for the wisdom of the Perl Monks concerning the following question:

Hi I new to Perl, I have a problem in using <DATA> file handle in Perl program in windows environment. I want to use data handle(using the data (format: _ _ DATA _ _) from the same script file but it give me an error: Program: while(<DATA>){ print if /Norma/; } _ _DATA_ _ Steve Blenheim Betty Boop Igor Chevsky Norma Cord Error description: Can't locate object method "DeLoach" via package "Karen" (perhaps you forgot to load "Karen"?) at test2.pl line 4.
  • Comment on <DATA> file handle not working with Perl Starwbery 5.12.1

Replies are listed 'Best First'.
Re: <DATA> file handle not working with Perl Starwbery 5.12.1
by Anonymous Monk on Dec 23, 2010 at 05:15 UTC
    What are those extra spaces you got there in __DATA__? Oh, and use <c>code here</c>

      This works fine for me.

      #! perl # use strict; use warnings; while(<DATA>){ print if /Norma/; } __DATA__ Steve Blenheim Betty Boop Igor Chevsky Norma Cord

      Result

      perl "D:\perl_TK\DBperl\perl6data.pl" Process started >>> Norma Cord <<< Process finished.
        Hi Thank you for help Cheers Sufi

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://878727]
Approved by broomduster
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found