[16969] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4381 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 20 00:05:26 2000

Date: Tue, 19 Sep 2000 21:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969422708-v9-i4381@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 19 Sep 2000     Volume: 9 Number: 4381

Today's topics:
         Ambiguous use of values  <star@sonic.net>
    Re: Candidate for the top ten perl mistakes list <lr@hpl.hp.com>
    Re: Char to Octoal... ? (Abigail)
    Re: Embed the perl mister <philipg@atl.mediaone.net>
    Re: File Parsing, Skipping lines <lr@hpl.hp.com>
    Re: HELP! Problem returning info from shell call <bwalton@rochester.rr.com>
    Re: How to make a child a parent ? (Martien Verbruggen)
        How to upload a file from a remote machine <hugo@fractalgraphics.com.au>
    Re: loop through file - how to loop back one line? <aqumsieh@hyperchip.com>
    Re: Parse::RecDescent: Problem with a Grammar (Abigail)
        Parsing Data in a string <adalessandro@odione.com>
    Re: passing variables to and from scripts <bwalton@rochester.rr.com>
    Re: Perl and Databases FAQ <nospam@david-steuber.com>
    Re: Perl and Databases FAQ (Chris Fedde)
    Re: Problem running script from a SSI command in IIS4 <agustinchernitsky@altavista.com>
        Pulling Oracle BLOBs using Perl & DBI on NT -- Help <objects@idirect.ca>
    Re: reading from file (Abigail)
        Reload, Reload, and No-Cache (BUCK NAKED1)
    Re: rounding error problem <bwalton@rochester.rr.com>
    Re: Stack commands in a system call <randy_734@my-deja.com>
    Re: Strange results using system vs backticks (Martien Verbruggen)
    Re: Teaching Perl (Abigail)
    Re: Unexpected behavior of shift in a loop (Abigail)
        use CGI qw(standard); vs. use CGI qw(:standard); <ronnie@catlover.com>
    Re: use CGI qw(standard); vs. use CGI qw(:standard); <philipg@atl.mediaone.net>
        What bits and pieces needed to compile modules on Win32 <objects@idirect.ca>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 20 Sep 2000 02:37:45 GMT
From: arthur <star@sonic.net>
Subject:  Ambiguous use of values 
Message-Id: <B5EC1FB0.87EA%star@sonic.net>

Hi All,

Sorry to ask so many dumb questions but I think I am learning :@)

I put this in a script to try and get a popup menu:
popup_menu(-name=>'game',
               -values=>['red','green','blue','chartreuse']),
and I get this:
# Ambiguous use of values => resolved to "values" =>.
File 'StarMax HD:Desktop Folder:popup.cgi'; Line 13
# Can't find string terminator "'" anywhere before EOF.
File 'StarMax HD:Desktop Folder:popup.cgi'; Line 14

anyone know why,
Thank You,
Arthur
star@sonic.net



------------------------------

Date: Tue, 19 Sep 2000 18:27:31 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <MPG.1431b25917e14d5698ad98@nntp.hpl.hp.com>

In article <8q8qt1$134$1@watserv3.uwaterloo.ca>, 
arpepper@math.uwaterloo.ca says...
> My candidate for the top ten perl mistakes list

Not likely.  I've never seen a question based on it in this newsgroup, 
for good reasons detailed below.

> Using close instead of closedir to close a handle opened using opendir.

opendir() isn't used often enough that any error based on closing a 
directory incorrectly could possibly be widespread.

closedir() or close() is seldom really needed, and if either is used it 
is seldom checked for error, so the likelihood of an error actually 
being reported because of the mistaken use of close() instead of 
closedir() is nil.

Keep trying, though!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: 20 Sep 2000 02:12:29 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Char to Octoal... ?
Message-Id: <slrn8sg767.5fq.abigail@alexandra.foad.org>

Alain BARBET (alian@alianwebserver.com) wrote on MMDLXXVII September
MCMXCIII in <URL:news:39C80528.9D019393@alianwebserver.com>:
?? > Nope.
?? > See perldoc -f oct.
?? 
?? I see. And there is something i think understand i don't really
?? understand.
?? oct may be use for
?? oct -> val and not val -> oct ?


Yes, but this val has nothing to do with the $val of the original posting.
A mapping 'val -> oct' doesn't have any use, as Perl doesn't do arithmetic
in octal. One might want to have an octal _representation_ of a value,
but for that one uses (s)printf.



Abigail
-- 
 :;$:=~s:
-:;another Perl Hacker
 :;chop
$:;$:=~y
 :;::d;print+Just.
$:;


------------------------------

Date: Wed, 20 Sep 2000 03:45:09 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Embed the perl mister
Message-Id: <9pWx5.272$PW4.322943@typhoon.southeast.rr.com>

Tom Fotheringham <tom@hughesmedia.co.uk> wrote in message
news:39C7482C.2EED3618@hughesmedia.co.uk...
> I really want to use Perl in a similar way as PHP.  How can I embed perl
> programs into HTML.  One way I thought of doing it was to read in top
> and bottom HTML pages from within perl and the output them.
>
> Can anyone shed some light on a more convientient way of doing it?
> Any pointers would be gratefully recieved.

I'm shocked that nobody's mentioned HTML::Mason yet.  It's got my vote.
http://www.masonhq.com/

There are several articles about how to use it here:
http://www.masonhq.com/articles.html.

hth,
p




------------------------------

Date: Tue, 19 Sep 2000 18:08:51 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: File Parsing, Skipping lines
Message-Id: <MPG.1431ae01228b8da998ad97@nntp.hpl.hp.com>

In article <8q8e0n$8vo$1@nnrp1.deja.com>, darkrabbit@my-deja.com says...
>  J. Stone <jstone211@my-deja.com> wrote:
> > If I know I need to move ahead a certain number of lines once I've
> > found an item in my file, what is the best way to do this?
> 
> I use ...
> 
> open( FILEHANDLE, "< $file);
> @filearray = <FILEHANDLE>;
> 
> ... then I have an array I can use to hop to specific line numbers.  This
> might be slow if you are parseing a long file.

Indeed it might.  Slurping an entire file is to be avoided if possible.

As forward motion is requested, it seems easiest to read and discard the 
specified number of lines.

    while (<FILEHANDLE>) {
        if (... found a item ...) {
              my $count = 5;
              while (<DATA>) { --$count or last }
         }
         # The next line of the file (if any) is now in $_
         ...
    }

> > Also, I need to find a particular header in a file, once I find that I
> > need to find another header ( the first header is not always followed
> > by the 2nd header, so I must verify)... then I can read lines and parse
> > using unpack.  Any tips?
> 
> If you have an array like my above example, you could probably test for that
> condition as you walk through it.  When you meet the condition yank the lines
> you need out.

Similarly to what I show above, but with a more elaborate test than 
simply counting.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Wed, 20 Sep 2000 01:44:55 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: HELP! Problem returning info from shell call
Message-Id: <39C816AE.4B119AD4@rochester.rr.com>

sommerm@apci.com wrote:
> 
> I am having a problem related to others, but haven't read an answer
> that helps me. I am trying to figure out why my script runs under perl
> 5.003, but when I switch to 5.004, lines such as
> 
> $variable = `c:\perl\bin\perl c:\ito\getlist_plugin.pl`;
> 
> are suddenly not returning anything. My script is a monitoring program,
> so it is very important that I get this working. Anyone have any ideas?
> I figure it might have something to do with the environmental variables
> (stdout) since even $client_name = `echo %COMPUTERNAME%` is not
> working. When I run this from the command prompt, everything works ok,
> but I need to have the command script be run by HP's OpenView
> Management Server. What can I do
> to fix this? I would really appreciate any help. Thank you!!
> 
> Melissa
 ...
I suggest you replace the backslashes with forward slashes and try it
again. Backslashes are treated as escape characters in back-tick-quoted
strings, and either is correctly interpreted as a path separator
character, even on Windoze.  Or properly quote your backslashes with a
second backslash.  See:

    perldoc perlop

The surprising thing is that it worked in 5.003.  I verify that code
like yours works in 5.6.0 ActiveState build 616 if you use forward
slashes or properly escape the backslashes.
-- 
Bob Walton


------------------------------

Date: Wed, 20 Sep 2000 01:07:39 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: How to make a child a parent ?
Message-Id: <slrn8sg3ea.hc9.mgjv@verbruggen.comdyn.com.au>

On Tue, 19 Sep 2000 16:46:45 -0400,
	Neb <berube@odyssee.net> wrote:
> Hi,
> 
> Suppose I got a process that fork a child.  The problem is that the child
> will run for a long period of time, way longer than the calling parent.  So,
> is there a way to make that child INDEPENDANT from the parent?

# perldoc perlipc
[snip]
       Complete Dissociation of Child from Parent
[snip]

>     system('notepad');

The perl emulation of fork on win32 may behave slightly differently. 

# perldoc perlfork

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | +++ Out of Cheese Error +++ Reinstall
Commercial Dynamics Pty. Ltd.   | Universe and Reboot +++
NSW, Australia                  | 


------------------------------

Date: Wed, 20 Sep 2000 11:04:15 +0800
From: Hugo Bouckaert <hugo@fractalgraphics.com.au>
Subject: How to upload a file from a remote machine
Message-Id: <39C8292F.EC228CBB@fractalgraphics.com.au>

Hi 

I would like to have a html page with several form fields, one of which
is an upload button. I would like the remote user to be able to send the
contents of the forms as an email, with an uploaded file sent as an
attachment.

I got the program working using the MIME::Lite module, but one simple
thing I overlooked: If the file is on the local server, it works OK, but
if not, I get an error message stating that the file is not readable -
this is obvious: the perl script handles the request on the local server
and hence files not on the local server cannot be found.  

The question is: how can this be done? How can I enable users of our
website to upload files as email attachments from their local computer,
to us? Is this possible at all?  

Any ideas? 

Thanks

Hugo 

-- 
Dr Hugo Bouckaert
R&D Support Engineer, Fractal Graphics 
39 Fairway, Nedlands Western Australia 6009
Tel: 9284 8442
Email:hugo@fractalgraphics.com.au
Web: http://www.fractalgraphics.com.au


------------------------------

Date: Wed, 20 Sep 2000 01:58:59 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: loop through file - how to loop back one line?
Message-Id: <7almwnrfh6.fsf@merlin.hyperchip.com>


jason <elephant@squirrelgroup.com> writes:

> the only real problem with saving the previous line is if the lines are 
> extremely long .. but - as I'm sure you know - this is almost never a 
> significant problem with a text file

And, you can solve this problem by simply keeping the length of the
previous line, rather the previous line itself, and seeking back that
many characters.

--Ala


------------------------------

Date: 20 Sep 2000 02:18:33 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Parse::RecDescent: Problem with a Grammar
Message-Id: <slrn8sg7hi.5fq.abigail@alexandra.foad.org>

Damian Conway (damian@cs.monash.edu.au) wrote on MMDLXXVII September
MCMXCIII in <URL:news:8q90jd$4jh$1@towncrier.cc.monash.edu.au>:
== abigail@foad.org (Abigail) writes:
== 
== >Stephen Collyer (stephen@twocats.dont-spam.demon.co.uk) wrote on MMDLXXVI
== >September MCMXCIII in <URL:news:969393483.15454.0.nnrp-10.9e98901a@news.demon.co.uk>:
== >[] 
== >[] Respect is due. This fixes the problem, but I'm baffled.
== >[] Surely { return EXPR } and { EXPR } are semantically
== >[] equivalent ?
== 
== >Absolutely not! 'return' returns from a sub, or an eval (or a do FILE).
== >{ EXPR } is just a block with an expression.
== 
== Indeed. The actions within a RecDescent rule are converted to C<do> blocks
== within the parsing subroutines RecDescent generates. Something like:
== 
== 	rule: /pattern/ subrule { action() }
== 
== becomes:
== 
== 	sub rule {
== 		# match against /pattern/
== 
== 		# recursively call subrule()
== 
== 		$result = do { action };
== 
== 		# other Important Stuff here
== 	}
== 
== 
== If you put a C<return> in an action, you blast straight out of the
== parsing subroutine, without doing the other Important Stuff :-(


Well, you could create something like:

   	sub rule {
   		# match against /pattern/
   
   		# recursively call subrule()
   
   		$result = sub { action } -> ();
   
   		# other Important Stuff here
   	}

and then 'return' would do what Stephen think it does.

It would also allow you to pass in neat stuff in @_.
(Like a reference to itself, so you can invoke your block recursively... ;-))


But I guess that would make Parse::RecDescent even slower that already
is. :(



Abigail
-- 
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_;
sub   _   {push         @_ => /::(.*)/s and goto &{ shift}}
sub shift {print shift; @_              and goto &{+shift}}
Hack ("Just", "Perl ", " ano", "er\n", "ther "); # 20000919


------------------------------

Date: Tue, 19 Sep 2000 22:57:15 -0400
From: "Arthur Dalessandro" <adalessandro@odione.com>
Subject: Parsing Data in a string
Message-Id: <ssgcsp3pum563@corp.supernews.com>

I have a string, lets say:
$temp = "SMTP <artd@artd3.com>"

I want to get the email address out of the string.  Is there an easy way to
go about doing this?  I suppose I could spit it twice, first get the data
after the "<"  then split again and get the data before the ">" but I was
hoping there would be a built in feature in perl to do this.  Please help.




------------------------------

Date: Wed, 20 Sep 2000 01:48:50 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: passing variables to and from scripts
Message-Id: <39C81799.B1524C50@rochester.rr.com>

potato_salad@my-deja.com wrote:
> 
> Hi, I am wanting to pass information from an entry box to a script to
> simply ping a host for example. Can someone please explain how to
>   store the info entered into the entry box as a variable and then pass
> it to my other script. thanks for any help. Yamar
 ...
Assuming your "entry box" is on a web page, you should start by reading
up on the CGI module:

    perldoc CGI

Otherwise, read up on Tk:

    perldoc Tk

-- 
Bob Walton


------------------------------

Date: Wed, 20 Sep 2000 01:13:01 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: Perl and Databases FAQ
Message-Id: <m3zol3sw6a.fsf@solo.david-steuber.com>

pohanl@my-deja.com writes:

' mySQL runs as a daemon, so it is safe for concurrent users.
' you can lock and unlock databases using SQL calls.  Most
' calls are atomic, and autocommit, so no need to worry about
' corruptions.

What if you have concurant users accessing the same rows in the same
tables?  Bob updates a row that Sue just selected.

The documentation and popularity isn't like it is with MySQL, but
PostgreSQL is not a bad ORDBMS.  I haven't pushed it hard yet, but it
seems to be able to perform ok.

If you are going to go beyond flat files, I think, with all due
respect, that the DBI module should receive as much attention as
possible.  With reasonable coding practices, it is not too difficult
to change database backends with out having to modify your Perl code
too much.  At least that is the theory.  Write once, anyone?

-- 
David Steuber | Perl apprentice, Apache/mod_perl user, and
NRA Member    | general Internet web wannabe.
ICQ# 91465842  (Using Micq 0.4.6 under Linux)

It's time to be free: http://www.harrybrowne2000.org


------------------------------

Date: Wed, 20 Sep 2000 01:30:40 GMT
From: cfedde@u.i.sl3d.com (Chris Fedde)
Subject: Re: Perl and Databases FAQ
Message-Id: <4rUx5.268$W3.171845632@news.frii.net>

In article <m3zol3sw6a.fsf@solo.david-steuber.com>,
David Steuber  <nospam@david-steuber.com> wrote:
>pohanl@my-deja.com writes:
>
>' mySQL runs as a daemon, so it is safe for concurrent users.
>' you can lock and unlock databases using SQL calls.  Most
>' calls are atomic, and autocommit, so no need to worry about
>' corruptions.
>
>What if you have concurant users accessing the same rows in the same
>tables?  Bob updates a row that Sue just selected.
>

Almost any reasonable database server will manage this level of concurrency
correctly.  Both Postgresql and MySQL definitely qualify in this regard.
Any continuation of this thread should probably be sent to one of the
database related news groups.

chris
-- 
    This space intentionally left blank


------------------------------

Date: Tue, 19 Sep 2000 22:16:50 -0300
From: "Agustin Chernitsky" <agustinchernitsky@altavista.com>
Subject: Re: Problem running script from a SSI command in IIS4
Message-Id: <8q9368$evunu$1@ID-48235.news.cis.dfn.de>

Yes, it looks like.... Thanks!


"jason" <elephant@squirrelgroup.com> wrote in message
news:MPG.143299c4b84f4ea09897b9@localhost...
Agustin Chernitsky <agustinchernitsky@altavista.com> wrote ..
>    I can't determine if this is a problem with my script or with my
server.
>I am running a simple time script, which is called from an HTML page using
>SSI. When I load the page, I get the following error: "Failed to execute
>script XXXXX. Win32 Errir cide 16389".
>
>I am running IIS 4 and ActiveState ActivePerl (the last version).
>
>If I test the   script alone, without the SSI, it works.
>
>Could this be a script problem or a server configuration problem?

from the (extremely) limited information you've provided - it sounds
like a server configuration problem

--
  jason -- elephant@squirrelgroup.com --




------------------------------

Date: Wed, 20 Sep 2000 01:21:41 GMT
From: "Bob Objects" <objects@idirect.ca>
Subject: Pulling Oracle BLOBs using Perl & DBI on NT -- Help
Message-Id: <FiUx5.29316$M%3.161826@quark.idirect.com>

Help!  I'm trying to use Perl & DBI to pull binary data (BLOB) out of my
Oracle database.  My script works perfectly when I run it on Linux
(eventually using Apache to display the binary data), but fails when I run
it from NT.

When I run the script on NT, I get the Oracle error:
DBD::Oracle::st execute failed: ORA-00932: inconsistent datatypes (DBD:
oexfet error) at H:\PERL&CGI\dbiblobtest.pl

The scripts runs perfectly on Linux ..

   # Standard DBI setup
     $ENV{'ORACLE_HOME'} = "d:/oracle/ora81/" ;  # NT
     #$ENV{'ORACLE_HOME'}="/home/oracle/OraHome1"; # Unix
     use DBI;

   # Connect to Oracle and pull some data out
     $dbh = DBI->connect("dbi:Oracle:host=linux;sid=orcl", 'system',
    'manager', {LongReadLen=>1000000}) || die "Connect Failed: $DBI::errstr"
;

   # FILE_CONTENT_BLOB is defined as a BLOB in Oracle
     $SQL ="SELECT FILE_CONTENT_BLOB
            FROM  FILE_CONTENT
            WHERE  DOC_ID = 2087 " ;
     $cur = $dbh->prepare($SQL) || die "Can't prepare SQL: $@ \n
$dbh::errstr \n" ;

     $cur->execute() || die "Can't execute SQL:\n" ;     # <-- FAILS HERE ON
NT
    # .. stuff that works on Linux/Apache removed (never gets here on NT)

Any ideas?  Why does it work in Linux?  How do I pre-define the datatype for
the Perl variable?   Has anyone else been able to get a BLOB out of Oracle
using Perl DBI on NT?

NT (PERL AND MOD'S FROM ACTIVESTATE BINARY DISTRIBUTION):
ActiveState's 5.005_03, DBI version 1.13  , DBD-Oracle VERSION=1,03,0,0,
SQL-Net 8.1.5 client
Linux: Version 5.005_03 , DBI 1.13, DBD::Oracle 1.03 12th July 1999,
SQL-Net 8.1.6 client

--
Bob Objects
objects@idirect.ca






------------------------------

Date: 20 Sep 2000 02:21:00 GMT
From: abigail@foad.org (Abigail)
Subject: Re: reading from file
Message-Id: <slrn8sg7m6.5fq.abigail@alexandra.foad.org>

Larry Rosler (lr@hpl.hp.com) wrote on MMDLXXVII September MCMXCIII in
<URL:news:MPG.1431a93da7aaecd698ad96@nntp.hpl.hp.com>:
<> In article <slrn8sfead.5fq.abigail@alexandra.foad.org>, abigail@foad.org 
<> says...
<> > Marvinas (Marvinas@Takas.lt) wrote on MMDLXXV September MCMXCIII in
<> > <URL:news:39c7a928@news.takas.lt>:
<> > @@ 
<> > @@     Hello,
<> > @@ 
<> > @@ Since I am just starting with perl I have this problem: I want to read a
<> > @@ integer from a file, but it returns string as an answer. How I could mak
<> > @@ program return integer?
<> > 
<> > 
<> > pack()
<> 
<> Huh?  I can see pack() being used to convert a string to a sequence of 
<> characters representing a binary encoding of an integer.  But just 
<> 'integer' in the question is more likely to mean 'Perl integer', which 
<> is entirely different.


But since a "Perl integer" is the same as the string, that would make for
a silly question. The only reasonable 'integer' is the binary encoding 
of one, hence pack().


Abigail
-- 
$;                                   # A lone dollar?
=$";                                 # Pod?
$;                                   # The return of the lone dollar?
{Just=>another=>Perl=>Hacker=>}      # Bare block?
=$/;                                 # More pod?
print%;                              # No right operand for %?


------------------------------

Date: Tue, 19 Sep 2000 22:19:34 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Reload, Reload, and No-Cache
Message-Id: <15013-39C82CC6-143@storefull-244.iap.bryant.webtv.net>

Is there a perl code that will refresh a page like Javascript does. I
need to re-load a page from the source, and I can't use JS. 

Also, is there a perl code for cancelling the cache. The meta tag
"no-cache" is unreliable. I want the page to reload from the webserver
each time.

Thanks,
Dennis



------------------------------

Date: Wed, 20 Sep 2000 01:58:58 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: rounding error problem
Message-Id: <39C819F9.9689DC4F@rochester.rr.com>

Jim Chim wrote:
> 
> Dear friend,
>     I have wrote a script for data analysis. The result is not
> reasonable.
> After inspection of the script, it might due to the rounding error of
> the data.
> My typical data attain values of 99999999, did perl are using double
> precision
> just like FORTRAN did or is there any function to handle this problem
> 
> Thanks
> Jim
By default, Perl's floating-point numbers have about 17 digits of
precision on most platforms (equivalent to Fortran's "double
precision").  Since you don't say anything about the computations you
are doing, it is impossible for anyone to say if roundoff at that level
is causing you problems.  You might consider the Math::BigFloat module
if 17 digits isn't enough for you.

Also, you might lose precision if you accidentally convert numbers to
strings and back again, so you might check for that.
-- 
Bob Walton


------------------------------

Date: Wed, 20 Sep 2000 01:18:56 GMT
From: Randy <randy_734@my-deja.com>
Subject: Re: Stack commands in a system call
Message-Id: <39c80fc8.13864406@207.126.101.100>

Excuse me for answering my own question, on NT it seems the command
separator is &&.   this_command  AND  that_command,  Whouda thunk?

system "cd somedir && dosomething";

Randy <randy_734@my-deja.com> wrote:

>Is there any way to stack multiple commands in a single system call on
>NT?  I've tried various:
>
>system ("cd somedir\n dosomthing");
>
>system ("cd somedir", "dosomething");
>
>system ("cd somdir"; "dosomething");
>
>and so on.  Nothing seems to work.



------------------------------

Date: Wed, 20 Sep 2000 01:10:03 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Strange results using system vs backticks
Message-Id: <slrn8sg3iq.hc9.mgjv@verbruggen.comdyn.com.au>

On Tue, 19 Sep 2000 15:29:15 -0700,
	Toni M. Vatcher <tmvatcher@bigfoot.com> wrote:
> <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
> <html>

My brain coredumps trying to read stuff like this. Please do not post
HTML. Usenet is a plain text medium, post plain text.

Thank you,
Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia                  | 


------------------------------

Date: 20 Sep 2000 02:31:43 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Teaching Perl
Message-Id: <slrn8sg8a9.5fq.abigail@alexandra.foad.org>

David Steuber (nospam@david-steuber.com) wrote on MMDLXXVII September
MCMXCIII in <URL:news:m34s3bubed.fsf@solo.david-steuber.com>:
-: 
-: Interestingly, Perl has more than one assignment operator.  You have
-: the simple assignment like this:
-: 
-: $foo = $bar;
-: 
-: Or something a little more lispy (if you stretch your imagination a
-: bit) like so:
-: 
-: { foo => bar };


Ok, you got me here. Which value is assigned to which variable? All I see
is a reference to hash here, and 2 warnings. The deparser agrees with me.



Abigail
-- 
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


------------------------------

Date: 20 Sep 2000 02:26:33 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Unexpected behavior of shift in a loop
Message-Id: <slrn8sg80j.5fq.abigail@alexandra.foad.org>

Joe Smith (inwap@best.com) wrote on MMDLXXII September MCMXCIII in
<URL:news:8ps1b5$13fv$1@nntp1.ba.best.com>:
;; In article <m3snrx865e.fsf@dhcp11-177.support.tivoli.com>,
;; Ren Maddox  <ren.maddox@tivoli.com> wrote:
;; >  join(" ", @fields[4..$#fields]);
;; >
;; >Off-thread-topic-side-note: I tried to use [4..-1] initially.  I don't
;; >know if it was because of the previous thread related to that, or
;; >because it just felt like it should work.  Of course, it didn't, but
;; >it still feels like it should....
;; 
;; This has been discussed on the perl5-porters list.
;; Using a negative number in the .. operator like that would be
;;   1) ambiguous, or
;;   2) break existing scripts.


Blah. "Break existing scripts" is a silly argument. Every new version
of Perl breaks scripts all over the place, yet that has never stopped
anyone from modifying perl.

See .sig for instance.


Abigail
-- 
print 74.117.115.116.32;
print 97.110.111.116.104.101.114.32;
print 80.101.114.108.32;
print 72.97.99.107.101.114.10;


------------------------------

Date: Wed, 20 Sep 2000 02:54:39 GMT
From: Ron Grabowski <ronnie@catlover.com>
Subject: use CGI qw(standard); vs. use CGI qw(:standard);
Message-Id: <39C826CD.80B15BD1@catlover.com>

How are the two lines above different? What does the ':' signify?


------------------------------

Date: Wed, 20 Sep 2000 03:18:59 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: use CGI qw(standard); vs. use CGI qw(:standard);
Message-Id: <D0Wx5.265$PW4.301002@typhoon.southeast.rr.com>

Ron Grabowski <ronnie@catlover.com> wrote in message
news:39C826CD.80B15BD1@catlover.com...
> How are the two lines above different? What does the ':' signify?

The first tries to import the symbol 'standard' from package CGI into
package main.  The second tries to import the _set_ of symbols associated
with the tag 'standard' from CGI into main.

See perldoc Exporter for more info.

hth,
p




------------------------------

Date: Wed, 20 Sep 2000 03:15:02 GMT
From: "Bob Objects" <objects@idirect.ca>
Subject: What bits and pieces needed to compile modules on Win32
Message-Id: <WYVx5.29357$M%3.164814@quark.idirect.com>

I ned to compile some modules (DBD:Oracle 1.06) for Win32 x86.
ActiveState's binary version is still 1.03.  But, I've never done it before.

Can anyone tell me the names of the programs I need.  Cygwin is the best
source for the GNU C compiler, but you have to know what you are looking for
(i.e. gcc-blah.tar ).  I don't know what linker, maker (Microsoft
nmake15.exe suggested) and the names of these files.

C Compiler     gcc
Linker             ?
make              Microsoft nmake
other??

Bob Objects
object@idirect.ca




------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 4381
**************************************


home help back first fref pref prev next nref lref last post