Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Perl
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Perl section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 23rd, 2013, 06:03 PM
Registered User
Join Date: Jul 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default cant go further.

Hi guys.
im a newbie. im sorry to waste your time. but i still hope to get help. im studying. can you explain to my why doesnt it work?

open (FILEHANDLE, data.txt) or
die "it doesnt work again: $!";

while (<FILEHANDLE>) {
print "$_\n";

Old December 20th, 2014, 09:16 AM
Registered User
Join Date: Dec 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to eurohttp
Default From where did you got this script?

I can tell you how to open and close filehandle like this:

@array = <FH>;

This is for reading. For writing change "<text.txt" to ">text.txt". For appending ">>text.txt".

Now chomp function you could use for STDIN input. You can add use foreach to list file content from array. after close(FH). If you plan to read from file it means. Its very simple.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.