Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^3: Creating a file by using perl

by freekngeek (Acolyte)
on Mar 28, 2013 at 12:31 UTC ( #1025950=note: print w/replies, xml ) Need Help??

in reply to Re^2: Creating a file by using perl
in thread Creating a file by using perl

Thanks a lot man, It's working fine. Just one more thing. Now, when I am printing out those lines, I need to use values from my array. I have a subroutine in which I am parsing values from a text file and the values are stored in an array, so can I just call a subroutine and use array reference to print out my text with the values from that array ? Because when I am doing that It's giving me this error

Global symbol "$one_ref" requires explicit package name at + line 12.

Replies are listed 'Best First'.
Re^4: Creating a file by using perl
by space_monk (Chaplain) on Mar 28, 2013 at 13:42 UTC

    You would have to show more of what you're trying to do. It's difficult to nearly impossible to work out where you're going wrong if you showing errors without the lines where they're occurring.

    From the error, it seems as though you haven't declared $one_ref in the main program or the method, whichever it happens to be. Somewhere you need a my ($one_ref);. But that's just a guess.

    Put an update at the end of the original question, with the code attached as it stands now. PerlMonks allows questions to change dynamically.

    A Monk aims to give answers to those who have none, and to learn from those who know more.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025950]
[Corion]: But maybe it's also due to that I play with friends, which makes a game more enjoyable anyway ;)
[Corion]: Oh - I released a new version of some module, thanks to a pull request. But I don't consider "update Makefile.PL" and "update author tests" as "writing code" ;-D
[marto]: sounds fun, the opposite of my weekend :P
[Corion]: marto: You wrote Perl? Or did you have to work (and wrote Perl)?
[marto]: the fun part, I had no fun this weekend, very stressful :)
[Corion]: But I feel an introductory talk gestating, working title "Reading CPAN" - how to read module documentation, how to judge a module, how to read the module tests/examples
[Corion]: marto: Ouch :-/ The kids are making trouble?
[Corion]: Meh - food becons, and colleagues are staring at me, talk to you later, sorry!

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2017-08-21 09:30 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (319 votes). Check out past polls.