Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Backticks and newlines...

by Rhose (Priest)
on Sep 05, 2001 at 21:21 UTC ( [id://110362]=note: print w/replies, xml ) Need Help??


in reply to system() and backticks question

I frequently use Perl scripts with Oracle's SQL*Plus (please don't ask... DBI/DBD is out in this situation... *Grins*) Anyway, here is a sample foreach loop I use to process the output from the Unix SQL*Plus.

foreach (split(/\n/,`$_SQLPLUS -silent /nolog \@$_TMPSCRIPT`)) { #-- Stuff }

This code executes a temporary SQL script with SQL*Plus, splits the output based on a newline, and processes each line (one at a time) as $_.

What I am trying to show is that newlines *ARE* preserved with backticks.

Replies are listed 'Best First'.
Re: Backticks and newlines...
by Jerry (Scribe) on Sep 05, 2001 at 22:03 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://110362]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 19:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found