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:
Storing the output of perl command in a file

 

First page Previous page 1 2 Next page Last page  View All


zak100
User

Dec 6, 2014, 10:45 AM

Post #26 of 27 (798 views)
Re: [FishMonger] Storing the output of perl command in a file [In reply to] Can't Post

Hi,
Thanks for your work. I able to figure out the problem. I also tried the same thing which you did, i.e. i typed :

Code
print "hello'

in the code window and i got following message in the output_error window:

Code
Can't find string terminator '"' anywhere before EOF at D:/Zulfi/dir1/filetest1.pl line 1.


But when i typed:

Code
Helloooooo


I did not get any error message. Then i stored the above text in a perl file: test.pl & tried following on my command window:

Code
C:\Apache\cgi-bin>perl test.pl 

C:\Apache\cgi-bin>type test.pl
helloyyyyyyyyy
C:\Apache\cgi-bin>type test.pl
helloyyyyyyyyy
helloyyyyyyyyy
C:\Apache\cgi-bin>perl test.pl
Can't locate object method "helloyyyyyyyyy" via package "helloyyyyyyyyy" (perhap
s you forgot to load "helloyyyyyyyyy"?) at test.pl line 1.

C:\Apache\cgi-bin>


which makes me clear that perl is not able to detect one line errors in a one line perl file which dont contain valid perl commands like print.

Zulfi.


FishMonger
Veteran / Moderator

Dec 6, 2014, 12:04 PM

Post #27 of 27 (794 views)
Re: [zak100] Storing the output of perl command in a file [In reply to] Can't Post

2 line test file

Quote
c:\test>type test.pl
helloyyyyyyyyy
helloyyyyyyyyy

c:\test>perl -we "eval <>; print $@" test.pl
Unquoted string "helloyyyyyyyyy" may clash with future reserved word at (eval 1) line 2, <> line 1.


1 line test file

Quote
c:\test>type test.pl
helloyyyyyyyyy

c:\test>perl -we "eval <>; print $@" test.pl
Unquoted string "helloyyyyyyyyy" may clash with future reserved word at (eval 1) line 2, <> line 1.



(This post was edited by FishMonger on Dec 6, 2014, 12:07 PM)

First page Previous page 1 2 Next page Last page  View All
 
 


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

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