CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [SteffenBaier] Read from Two files and create multiple Files: Edit Log



FishMonger
Veteran / Moderator

May 30, 2017, 7:20 AM


Views: 2260
Re: [SteffenBaier] Read from Two files and create multiple Files


Quote
and I assume this works as there is no error

You're not receiving any errors because to told perl to not tell you about the errors.

Why did you comment out the warnings and strict use statements? Doing that tells perl that you want it to ignore your errors, which is a really bad idea. It's almost like driving your car with a blindfold over your eyes.

The script is using a number of very poor coding practices making the code more difficult to read and maintain and debug.


Code
print OUT "$fh";

$fh does not hold a string; it is a typeglob, which is why you're getting that output.

You need to read from that filehandle (typeglob) to get at the contents of the file. The easiest way to do that is to use the < > diamond operator instead of the double quotes.

Code
print OUT <$fh>;



(This post was edited by FishMonger on May 30, 2017, 7:20 AM)


Edit Log:
Post edited by FishMonger (Veteran) on May 30, 2017, 7:20 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives