Re: The Perl question of the here document

2009-10-21 Thread John W. Krahn
Majian wrote: Dear list: Hello, Sorry to distrub all . When I learned Perl on the book called "Perl by example 4th Chinese Edition ", I found there was an error on this book . There had a perl script writted by this : #!/usr/bin/perl

The Perl question of the here document

2009-10-21 Thread Majian
Dear list: Sorry to distrub all . When I learned Perl on the book called "Perl by example 4th Chinese Edition ", I found there was an error on this book . There had a perl script writted by this : #!/usr/bin/perl print << 'END';

Re: subroutine in here document

2008-03-14 Thread Jenda Krynicky
From: "Kashif Salman" <[EMAIL PROTECTED]> > I know I can create html code using CGI and call a subroutine in there > easily but if i were to use a here document for my html code, can I > call a subroutine in there? > > print< HTML code >

Re: subroutine in here document

2008-03-14 Thread Rob Dixon
Kashif Salman wrote: > I know I can create html code using CGI and call a subroutine in there easily but if i were to use a here document for my html code, can I call a subroutine in there? print< Yes you can, but I'd rather not tell you how because it's likely to be the ug

Re: subroutine in here document

2008-03-14 Thread Gunnar Hjalmarsson
Kashif Salman wrote: I know I can create html code using CGI and call a subroutine in there easily but if i were to use a here document for my html code, can I call a subroutine in there? print< Check out the FAQ entry perldoc -q "function calls" -- Gunnar Hjalmarsso

subroutine in here document

2008-03-14 Thread Kashif Salman
I know I can create html code using CGI and call a subroutine in there easily but if i were to use a here document for my html code, can I call a subroutine in there? print<http://learn.perl.org/

RE: Run a block of sql commands using 'here document'

2007-06-08 Thread Lakshmi Sailaja
Cool...This worked!!! Thanks a zillion for the response!! Thanks & Regards, Lakshmi 952-833-1220 -Original Message- From: Adriano Ferreira [mailto:[EMAIL PROTECTED] Sent: Friday, June 08, 2007 11:56 AM To: beginners@perl.org Subject: Re: Run a block of sql commands using 'here

Re: Run a block of sql commands using 'here document'

2007-06-08 Thread Adriano Ferreira
what do you think about that: open(DBI, "| sqlplus user/[EMAIL PROTECTED]"); then print DBI with a Here Document? that should work, shouldn't it? Martin's idea seems the way to go. You can abstract it via sub sqlplus { my $param = shift; my $script_text

Re: Run a block of sql commands using 'here document'

2007-06-08 Thread Martin Barth
lplus user/[EMAIL PROTECTED]"); then print DBI with a Here Document? that should work, shouldn't it? HTH Martin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Run a block of sql commands using 'here document'

2007-06-08 Thread Lakshmi Sailaja
Hi, I know that using 'Here Documents', we can output multiple lines. But is it possible to run a couple of commands? $s = qx [sqlplus user/[EMAIL PROTECTED]

Re: Appending constant string to variable inside a here-document

2005-03-08 Thread David Storrs
On Sun, Mar 06, 2005 at 11:21:23PM -0600, Charles K. Clarkson wrote: > Harold Castro <mailto:[EMAIL PROTECTED]> wrote: > : if the current content of $word is the word "big", and > : I would want to print a here document appending > : something to "big" like

RE: Appending constant string to variable inside a here-document

2005-03-06 Thread Charles K. Clarkson
Harold Castro <mailto:[EMAIL PROTECTED]> wrote: : I'm trying to loop into printing a series of lines so : I used here document. Substitution of variables, e.g., : $_ works inside the HERE-Document but appending a : string won't work : : For example: : : if the current content

Appending constant string to variable inside a here-document

2005-03-06 Thread Harold Castro
Hi, I'm trying to loop into printing a series of lines so I used here document. Substitution of variables, e.g., $_ works inside the HERE-Document but appending a string won't work For example: if the current content of $word is the word "big", and I would want to p

Re: here document question

2003-06-28 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > Hi - Hello, > I am grinding through =Programming Perl= and came to the section on Here > Documents in Chapter 2 (forgive me, I can't think of the term "Here documents" > without thinking that there must be a dog somewhere named Documents). > > Anyhoo, I tried typing

Re: here document question

2003-06-28 Thread Rob Dixon
ng to be printed. If I don't put that blank line in, I get the error > > Can't find string terminator anywhere before EOF at ./perlcamel.pl line 3 > Hi Kevin. The text of a 'here' document is everything up to a line containing the string following '<<' on a l

Re: here document question

2003-06-28 Thread burningclown
> Here documents always need a termination. Maybe you'd see it better > if you use a more visible one: thanks to those who responded to my question :) here, document! glenn +-+ There are no motionless targets +-+ -- To uns

Re: here document question

2003-06-28 Thread Harry Putnam
[EMAIL PROTECTED] writes: > print << x 10; > The camels are coming! Here documents always need a termination. Maybe you'd see it better if you use a more visible one: $ perl -e 'print < EOM' Note (sort of starndard) terminator used here is EOM. Thats how here docs work. They puke out everythi

Re: here document question

2003-06-28 Thread Kevin Pfeiffer
new­ line after it; otherwise, Perl will give the warn­ ing Can't find string terminator "END" anywhere before EOF I'm not familiar (haven't read Programming Perl, yet) with this form of the here-document ("self-terminat

here document question

2003-06-28 Thread burningclown
Hi - I am grinding through =Programming Perl= and came to the section on Here Documents in Chapter 2 (forgive me, I can't think of the term "Here documents" without thinking that there must be a dog somewhere named Documents). Anyhoo, I tried typing some of the examples at the keyboard. They s

Re: here document

2002-05-09 Thread Chas Owens
On Thu, 2002-05-09 at 13:45, Elliott M Moskowitz wrote: > How do you implement a Unix shell "here" document in perl ? Do you mean a here string like this: my $string = <<'ENDOFSTRING'; this is a string. ENDOFSTRING or to you mean real here files like this: ../scri

Re: here document

2002-05-09 Thread Michael Kelly
On 5/9/02 10:45 AM, Elliott M Moskowitz <[EMAIL PROTECTED]> wrote: > How do you implement a Unix shell "here" document in perl ? $stuff = <

here document

2002-05-09 Thread Elliott M Moskowitz
How do you implement a Unix shell "here" document in perl ? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: multiple __DATA__ entries possible? -- use (a here document)

2002-02-15 Thread William.Ampeh
The closest you can get is to specify "a here document". That is: my @array=(<<"END_DATA" =~ m/^\s*(.+)/gm) stuff in data more stuff data END_DATA ; my @array1=(<<"

Re: Firing a subroutine from within a here-document

2001-11-25 Thread Jenda Krynicky
From: Chris Spurgeon <[EMAIL PROTECTED]> > I have this code snippet... > print < > I think x is $x and y is $y. > &foobar > Did the subroutine fire? > > END_OF_STUFF > > > When I run it, the scalar variables $x and $y are interpreted in the print > statement, but the subrout

Firing a subroutine from within a here-document

2001-11-24 Thread Chris Spurgeon
I have this code snippet... $x = 1; $y = 2; sub foobar { print "You fired the subroutine!\n"; } print <

follow up: interpolation of variables in here document

2001-07-24 Thread KAVANAGH, Michael
Sorry... you can completely ignore my previous message about here documents. It is working now, and the syntax was right. I was just looking at the wrong output! Mike Mike Kavanagh Internet Development Manager Oxford University Press W: http://www.oup.com V: +44 (0) 1865 267452 Fax: +44 1865

Re: What is a HERE Document?

2001-07-19 Thread Tina Messmann
ched the Indexes of the books without finding HERE documents, after reading your post i searched again and - you are right- found the word HERE Document in the Index of the Camel book. Sorry about that. Regards Tina -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: What is a HERE Document?

2001-07-19 Thread Sascha Kersken
Hi! A HERE document is a very fine feature of Perl that makes it easy to handle long, multi-line strings. Like so: print << "MYLABEL"; All of this rubbish will be printed including the line wraps until it finds MYLABEL - the word 'MYLABEL' won't print anymore. I

What is a HERE Document?

2001-07-19 Thread Tina Messmann
Hi All, could someone please explain to me what a HERE Document is? I can't find it in my books. Regards Tina -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]