[23752] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5956 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 19 03:05:51 2003

Date: Fri, 19 Dec 2003 00:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 19 Dec 2003     Volume: 10 Number: 5956

Today's topics:
    Re: A way to grab string from another program in perl? (Tad McClellan)
    Re: A way to grab string from another program in perl? <matthew.garrish@sympatico.ca>
        Add Files to Zip File <mikeflan@earthlink.net>
    Re: Add Files to Zip File <nospam@bigpond.com>
    Re: Add Files to Zip File <mikeflan@earthlink.net>
    Re: Creating a list of HASHes <1usa@llenroc.ude>
        Cross compiling 5.8.2 for an arm Xscale <nospam@nospam.com>
    Re: Determine DaysInMonth($month) <matthew.garrish@sympatico.ca>
    Re: Determine DaysInMonth($month) <carsten@welcomes-you.com>
    Re: getting error for modules (debraj)
    Re: perl golf techniques (Jay Tilton)
    Re: Please critique this short script that scans a log  (Tad McClellan)
        Problem with DBI MySQL (UPDATE command) (Brad)
    Re: Problem with DBI MySQL (UPDATE command) <bigiain@mightymedia.com.au>
    Re: Problems reading in "£" character from a file  <stephen.adaam@ntlworld.com>
    Re: RegExp check for nothing or pattern (Tad McClellan)
    Re: regular expression for perl, tcl, sed, grep, awk (Jay eL)
        script works, but shows error <webmaster@lowestdomains.info>
    Re: script works, but shows error <jurgenex@hotmail.com>
    Re: script works, but shows error <jwillmore@remove.adelphia.net>
    Re: script works, but shows error <jurgenex@hotmail.com>
    Re: script works, but shows error (Tad McClellan)
    Re: Signaling another machine <jgibson@mail.arc.nasa.gov>
    Re: strange results using m//g in while loop... <not_a_real@adress.getting.too.much.spam.org>
    Re: strange results using m//g in while loop... (Tad McClellan)
    Re: ticks and FreeBSD <jundy@jundy.com>
    Re: When closing DOS window... (R Solberg)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 18 Dec 2003 12:50:27 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: A way to grab string from another program in perl?
Message-Id: <slrnbu3tnj.jo8.tadmc@magna.augustmail.com>

Jeff <jeffrey@cunningham.net> wrote:

> What a pack of asses you are.


Then don't come here!


> In any event, the reference you gave didn't even answer the question, so
> you are fools as well. 


Yes it did.


   perldoc -f system

        This is not what you want to use to
        capture the output from a command, for that you
        should use merely backticks or "qx//"



I think most people reading this thread might have a different
opinion on who is the fool.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 18 Dec 2003 19:54:10 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: A way to grab string from another program in perl?
Message-Id: <K_rEb.18941$CK3.1750191@news20.bellglobal.com>


"Jeff" <jeffrey@cunningham.net> wrote in message
news:pan.2003.12.18.16.49.29.567540@cunningham.net...

> In any event, the reference you gave didn't even answer the question, so
> you are fools as well. The correct answer would have been:
>
> $string = `someprogram @args`;
>
> If YOU all had read your own reference closely, you would have noticed
> that the system function returns the error code, not what goes to STDOUT.

Despite your obvious dyslexia you were able to figure out the answer. Kudos
to you!

Matt




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

Date: Fri, 19 Dec 2003 01:26:05 GMT
From: Mike Flannigan <mikeflan@earthlink.net>
Subject: Add Files to Zip File
Message-Id: <3FE25474.857FAC8@earthlink.net>


I'm trying to modify the script below to ADD files to
existing zip files.  This script is good at CREATING zip files
with one file in each zip.  I want to add other files to
these zip files.  I've tried changing
my $zip = new Archive::Zip;
to
my $zip = addFile Archive::Zip;
and
my $zip = add Archive::Zip;
and tried a few other things, but none worked.

Oddly, the CPAN site is down for some reason!
http://www.perl.com/CPAN-local/README.html

So I went to the POD.  One thing I was afraid to try
is:
my $member = Archive::Zip::Member->newFromFile( 'xyz.txt' );

Is this what I should do?


Mike


use warnings;
use strict;

use File::Find;
use Archive::Zip;

my $dir = 'c:/Copy2';

find sub {
    ( my $name = $_ ) =~ m/.*(?=\.\w{3})/;
    return if -d;
    return if /Io\.sys/;
    return if /Msdos\.sys/;
    return if /.*\.zip/i;
    print "$name - $& \n";
    my $zip = new Archive::Zip;
    $zip->addFile($name);
    $zip->writeToFileNamed($& . ".zip");
} => $dir;

__END__



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

Date: Fri, 19 Dec 2003 12:28:47 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Add Files to Zip File
Message-Id: <11927895.v2YOtlDYiI@gregs-web-hosting-and-pickle-farming>

It was a dark and stormy night, and Mike Flannigan managed to scribble:

> 
> I'm trying to modify the script below to ADD files to
> existing zip files.  This script is good at CREATING zip files
> with one file in each zip.  I want to add other files to
> these zip files.  I've tried changing
> my $zip = new Archive::Zip;
> to
> my $zip = addFile Archive::Zip;
> and
> my $zip = add Archive::Zip;
> and tried a few other things, but none worked.
> 

What do you mean "none worked". No output? Resulting file appears to be in wrong format?
I've used this module extensively. I suspect you should call $zip->writeToFileNamed only once at the end, after you have added all the files to the archive.

(FWIW i've modified Archive::Zip to do incremental output after each member, as the zip archive has its index at the end from the zip file)

gtoomey


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

Date: Fri, 19 Dec 2003 03:02:04 GMT
From: Mike Flannigan <mikeflan@earthlink.net>
Subject: Re: Add Files to Zip File
Message-Id: <3FE26AF3.D48C745D@earthlink.net>


Gregory Toomey wrote:

> What do you mean "none worked". No output? Resulting file appears to be in wrong format?
> I've used this module extensively. I suspect you should call $zip->writeToFileNamed only once at the end, after you have added all the files to the archive.
>
> (FWIW i've modified Archive::Zip to do incremental output after each member, as the zip archive has its index at the end from the zip file)
>
> gtoomey

By "none worked" I mean none would add any other files
to the zip file.  I'm trying to add all the files in the directoy
to a single zip file.  Sounds like it would be easy, but in
my Google searches, I simply find other people asking
the same thing I'm asking.  That module documentation
is not clear to me (and others).  I'm guessing that when
I finally get it, I still won't understand it  :-)

I'll keep trying, but this certainly doesn't work:


use warnings;
use strict;

use File::Find;
use Archive::Zip;

my $dir = 'c:/Copy2';

find sub {
    ( my $name = $_ ) =~ m/.*(?=\.\w{3})/;
    return if -d;
    return if /Io\.sys/;
    return if /Msdos\.sys/;
    return if /.*\.zip/i;
    print "$name - $& \n";
    my $zip = new Archive::Zip;
#    $zip->addFile('file.zip');
    $zip->addFile($File::Find::name);
#    my $member = $zip->addFile('file12.doc', 'file13.doc', 'file15.doc' );
#    $zip->writeToFileNamed("file.zip");
} => $dir;
$zip->writeToFileNamed("file.zip");

__END__




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

Date: 19 Dec 2003 07:56:06 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Creating a list of HASHes
Message-Id: <Xns94561DDB5C8ACasu1cornelledu@132.236.56.8>

"A. Sinan Unur" <1usa@llenroc.ude> wrote in
news:Xns94555BDBBC99Aasu1cornelledu@132.236.56.8: 

> sub somesub {
>   my $var = @_;
> }

my ($var) = @_;

Arrrgh!
-- 
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)


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

Date: Thu, 18 Dec 2003 18:59:48 -0800
From: Zach <nospam@nospam.com>
Subject: Cross compiling 5.8.2 for an arm Xscale
Message-Id: <brtq1f$3fl$1@overload.lbl.gov>

I am trying to compile perl 5.8.2 for my Arcom Viper single board 
computer. It runs an arm xscale processor.  I am using their tool chain 
which seems to work quite well.  However, when I try to compile perl as 
per the instructions in the /Cross directory, I end up failing with this 
error:

---------------------------------------------------
You may see some irrelevant test failures if you have been unable
to build lib/Config.pm or lib/lib.pm.

cd t && (rm -f perl; /bin/ln -s ../miniperl perl) \
         && LD_LIBRARY_PATH=/home/xaq/carbon/src/perl-5.8.2 ./perl TEST 
base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty
/bin/sh: ./perl: cannot execute binary file
make[4]: [minitest] Error 126 (ignored)
make[4]: Leaving directory `/home/xaq/carbon/src/perl-5.8.2'
mv miniperl miniperl-arm
ln -s /usr/bin/perl miniperl
/usr/bin/perl -Ifake_config_library -MConfig installperl  -s
Can't load 'lib/auto/File/Glob/Glob.so' for module File::Glob: 
lib/auto/File/Glob/Glob.so: ELF file OS ABI invalid at lib/XSLoader.pm 
line 68.
  at lib/File/Glob.pm line 96
Compilation failed in require at installperl line 131.
BEGIN failed--compilation aborted at installperl line 131.
make[3]: *** [install.perl] Error 255
make[3]: Leaving directory `/home/xaq/carbon/src/perl-5.8.2'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/home/xaq/carbon/src/perl-5.8.2'
make[1]: *** [install-strip] Error 2
make[1]: Leaving directory `/home/xaq/carbon/src/perl-5.8.2'
make: *** [perl] Error 2
[root@dw Cross]#
---------------------------------------------

Any thoughts?

Zach

my email address is contact att buildcoolstuff dott com
 ...Please no spam



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

Date: Thu, 18 Dec 2003 21:00:33 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Determine DaysInMonth($month)
Message-Id: <YYsEb.19019$CK3.1776254@news20.bellglobal.com>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:brso5c$oc6$1@mamenchi.zrz.TU-Berlin.DE...
> Carsten Aulbert  <carsten@welcomes-you.com> wrote in comp.lang.perl.misc:
> >
> >
> >
> >    # February has always 28 days, except if the year is
> >    # dividable by 4 (without remainder). Exceptions are
> >    # full centuries
> >
> >    return 29 if $year % 4 == 0 and $year % 100 != 0;
> >    return 29 if $year % 400 == 0;
> >    return 28;
> > }
>
> The code is fine, as far as I can tell from manual inspection, but the
> comment doesn't match the code.  It fails to acknowledge the exception
> from the exception for years divisible by 400.
>
> I mention this not for the pure joy of pedantry (or not purely for the
> joy of pedantry), but because it is a good illustration of how fragile
> comments are.  I mean, a slip like that happens easily, in fact it's hard
> to avoid entirely when you do a lot of commenting.  It wouldn't even hurt
> much in this case because the leap year algorithm is well known and easily
> accessible.
>

Now that I'm a little more awake...

I don't disagree with you that commenting scripts is an art unto itself, but
I think you are being more than a little pedantic in this case. He clearly
wrote that "full centuries" are an exception. I think it would be encumbent
upon the person reading the code to figure out that "full centuries"
includes a check that they aren't divisible by 400. Instead of changing his
comment, he probably could have changed his code to:

if ($year % 4 == 0) {

   return 29 if $year % 100 != 0 or $year % 400 == 0;

}

This way the century checks are more clearly delineated from the "divisible
by 4" rule. Either way, I wouldn't go so far as to say that his original
comment was misleading in any way.

Matt




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

Date: Fri, 19 Dec 2003 08:12:01 +0100
From: Carsten Aulbert <carsten@welcomes-you.com>
Subject: Re: Determine DaysInMonth($month)
Message-Id: <bru8cr$7hjdp$1@ID-213226.news.uni-berlin.de>



Anno Siegel wrote:

> The code is fine, as far as I can tell from manual inspection, but the
> comment doesn't match the code.  It fails to acknowledge the exception
> from the exception for years divisible by 400.
> 

Ash on my head (German saying, meaning, you are totally right and I forgot 
something). Yes, "return 29 if $year % 400 == 0;" takes care of this, 
however, I'm not 100% sure if there are other exceptions. I'm pretty sure, 
there are none in the near future, but don't use this code to go back in 
time before roughly 1800. Depending on each country the calender changed 
(UK + colonies switched to Gregorian calender in 1752, see 'man cal' on a 
*nix system with cal installed:
[08:08] carsten@nbdell10:carsten$ cal 9 1752
    September 1752
Su Mo Tu We Th Fr Sa
        1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30


> I mention this not for the pure joy of pedantry (or not purely for the
> joy of pedantry), but because it is a good illustration of how fragile
> comments are.  I mean, a slip like that happens easily, in fact it's hard
> to avoid entirely when you do a lot of commenting.  It wouldn't even hurt
> much in this case because the leap year algorithm is well known and easily
> accessible.
> 

But still you are right. I promise to take better care, at least for 
posting to this NG. But still without the comments, might be a nice try 
for perlgolf (without comments I suppose), but I'm leaving the scope of 
this NG.

> But finding one comment in a program that's clearly out of sync with the
> code means that you'll have to think of that possibility with every comment
> in the program.  That reduces their utility considerably.  Old story about
> one bad apple...
> 
which "infects" other apples.

> I guess what I'm saying is not that comments are useless, but they take
> more effort, in writing *and* maintenance, than is usually acknowledged.
> They should be considered potentially expensive parts of the code that
> are to be used sparingly, not proliferated.
> 

100% ACK

CA


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

Date: 18 Dec 2003 23:34:49 -0800
From: debhatta@hotmail.com (debraj)
Subject: Re: getting error for modules
Message-Id: <f9f243e.0312182334.4fcf8c4c@posting.google.com>

James Willmore <jwillmore@remove.adelphia.net> wrote in message news:<20031216011323.6aea7ba4.jwillmore@remove.adelphia.net>...
> You know ..... I gave this directory a second look after posting.  Are
> you sure about the directory
> /home/ngraving/../libs ?
> Or did you just clip the path down?
>  
> > perldoc perlfaq8
> > -or-
> > perldoc -q 'lib'
> 
> Have a look at the above documents to (dis)prove the soulutions given.

I just gave the path ..The error was coming something like that . 
Thanx for ur replies..I have got what I wanted ...


Many thanx
Debhatta


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

Date: Fri, 19 Dec 2003 00:48:47 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: perl golf techniques
Message-Id: <3fe249f3.4299694@news.erols.com>

googlegroups@scottsavarese.com (Scott) wrote:

: My company is running a perl golf contest 

Can your company afford to float a period of zero-productivity?  :)

I had to give up competitive Perl golf.  It was a deadly addiction.

: and I am looking for some
: tricks hints and techniques that I could use to help with my code. Do
: you guys know any good websites, or news threads, that I could look at
: which discuss the things people do to help to reduce the length of
: their code?

Some good starting points:
    http://perlgolf.sourceforge.net/
    http://perlgolf.org/

There are details of a number of past competitions on those sites,
including piles of code and discussions of players' inspirations and
algorithms.

Coming up with tips to improve your game is difficult.  It's an art to
learn more than it is a craft to teach.

Study perlrun.  There's powerful juju in those switches.

Some operators and functions have return values that you don't care about
in everyday code, but are beneficial in golfing.  Study perlop, perlfunc,
and perlvar, especially the bits you've never used in your life.

Squish your code through the B::Deparse backend once in a while.  The
deparser will often rearrange what you've written into dramatically
different syntax, which can give you ideas on tightening things up.

Drink lots of fluids.



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

Date: Thu, 18 Dec 2003 12:44:33 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Please critique this short script that scans a log file
Message-Id: <slrnbu3tch.jo8.tadmc@magna.augustmail.com>

Matija Papec <perl@my-header.org> wrote:
> Uri Guttman <uri@stemsystems.com> wrote:

>>		next ;


> On the other hand you can't use "next" outside of loops, 


But a "naked block" counts as a loop, so you _can_ use them outside
of (actual) loops:


   {
      ...
      last if something();
      ...
   }


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 18 Dec 2003 21:34:32 -0800
From: pj_sammie@hotmail.com (Brad)
Subject: Problem with DBI MySQL (UPDATE command)
Message-Id: <2abd2946.0312182134.7bc80d57@posting.google.com>

I am trying to update records in a MySQL table using DBI and DBD
MySQL. I am receiving the following error:

DBD::mysql::db do failed: You have an error in your SQL syntax.  Check
the manual that corresponds to your MySQL server version for the right
syntax to use near '' at line 31 at script.pl line 287, <VARIABLER>
line 17.

The code where I am trying to update:
--------
    #Update player data
    $dbh->do("UPDATE archivestats SET
    score=score+'$sqlsession[6]',
    enemyaircraftkills=enemyaircraftkills+$sqlsession[8],
    enemystaticaircraftkills=enemystaticaircraftkills+$sqlsession[9],
    enemytankkills=enemytankkills+$sqlsession[10],
    enemycarkills=enemycarkills+$sqlsession[11],
    enemyartillerykills=enemyartillerykills+$sqlsession[12],
    enemyaaakills=enemyaaakills+$sqlsession[13],
    enemywagonkills=enemywagonkills+$sqlsession[14],
    enemyshipkills=enemyshipkills+$sqlsession[15],
    friendlyaircraftkills=friendlyaircraftkills+$sqlsession[16],
    friendlystaticaircraftkills=friendlystaticaircraftkills+$sqlsession[17],
    friendlytankkills=friendlytankkills+$sqlsession[18],
    friendlycarkills=friendlycarkills+$sqlsession[19],
    friendlyartillerykills=friendlyartillerykills+$sqlsession[20],
    frienldyaaakills=frienldyaaakills+$sqlsession[21],
    friendlywagonkills=friendlywagonkills+$sqlsession[22],
    friendlyshipkills=friendlyshipkills+$sqlsession[23],
    firedbullets=firedbullets+$sqlsession[24],
    hitbullets=hitbullets+$sqlsession[25],
    hitairbullets=hitairbullets+$sqlsession[26],
    firedrockets=firedrockets+$sqlsession[27],
    hitrockets=hitrockets+$sqlsession[28],
    droppedbombs=droppedbombs+$sqlsession[29],
    directhitbombs=directhitbombs+$sqlsession[30],
    ipaddress='$sqlsession[31]',
    country='$sqlsession[32]',
    landings=landings+$sqlsession[34],
    bails=bails+$sqlsession[35],
    crashes=crashes+$sqlsession[36],
    totaltimeplayed=totaltimeplayed+$sqlsession[38]
    WHERE id=$archiveid");
--------

I have checked the MySQL syntax from the reference documentation, and
everything looks ok (to me). Any ideas?

Thanks for any help,
Brad


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

Date: Fri, 19 Dec 2003 17:04:50 +1100
From: Iain Chalmers <bigiain@mightymedia.com.au>
Subject: Re: Problem with DBI MySQL (UPDATE command)
Message-Id: <bigiain-681615.17045019122003@news.fu-berlin.de>

In article <2abd2946.0312182134.7bc80d57@posting.google.com>,
 pj_sammie@hotmail.com (Brad) wrote:

> I am trying to update records in a MySQL table using DBI and DBD
> MySQL. I am receiving the following error:
> 
> DBD::mysql::db do failed: You have an error in your SQL syntax.  Check
> the manual that corresponds to your MySQL server version for the right
> syntax to use near '' at line 31 at script.pl line 287, <VARIABLER>
> line 17.

Thats a MySQL error, not a perl one, so this isn't really the right 
group to ask... Having said that,
> 
> The code where I am trying to update:
> --------
>     #Update player data
>     $dbh->do("UPDATE archivestats SET
>     score=score+'$sqlsession[6]',
------------------^--------------^
do you really have those quotes there?

You don't have them in all the _other_ lines that look like they're 
doing simple addition, like this one:

>     enemyaircraftkills=enemyaircraftkills+$sqlsession[8],

cheers,

big

-- 
'When I first met Katho, she had a meat cleaver in one hand and
half a sheep in the other. "Come in", she says, "Hammo's not here.
I hope you like meat.' Sharkey in aus.moto


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

Date: Fri, 19 Dec 2003 03:43:28 -0000
From: "Stephen Adam" <stephen.adaam@ntlworld.com>
Subject: Re: Problems reading in "£" character from a file 
Message-Id: <wtuEb.813$Ec6.700540@newsfep1-win.server.ntli.net>

Thanks for the help, that one had me stumped for a while.

Cheers

Steve





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

Date: Thu, 18 Dec 2003 18:07:34 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: RegExp check for nothing or pattern
Message-Id: <slrnbu4ga6.k08.tadmc@magna.augustmail.com>

Eric <Eric@nowhere.com> wrote:

> Jeez you guys take this so seriously don't you!


There was no smiley in your followup. 

We are not mind readers.


> Get a grip guys!


Too late.

Killfile entries go in, but they don't come out.

Have a happy life.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 18 Dec 2003 22:38:48 -0800
From: xiaohwarang@yahoo.co.uk (Jay eL)
Subject: Re: regular expression for perl, tcl, sed, grep, awk
Message-Id: <9079c005.0312182238.2463491a@posting.google.com>

Thanks for the reply.  I posted in this forum becuase I first learn
Perl before using awk, sed, tcl and grep.  When I saw their RE, I
wonder all the things I have learned in Perl could apply to all of
this, if not that will be very confusing.



Martien Verbruggen <mgjv@tradingpost.com.au> wrote in message news:<slrnbtael6.hsp.mgjv@verbruggen.comdyn.com.au>...
> On 8 Dec 2003 17:59:53 -0800,
> 	Jay eL <xiaohwarang@yahoo.co.uk> wrote:
> > Hi all,
> > 
> > I wonder is the regular expression the same for perl, tcl, sed, grep
> > and awk except for the syntax?
> 
> It's a bit of an odd question. What do you mean "the same" "except for
> the syntax"? The syntax is different in many cases, and the features
> are also different for many of them. It also depends on your platform
> which sorts of RE are supported by your sed, grep and awk. There are
> minimal sets defined by standards, but that doesn't mean that your
> local ones don't support more.
> 
> Generally: unless the software specifically mentions that it supports
> Perl's RE, it won't. Perl's RE engine is pretty much the most powerful
> out there (pcre is a library making Perl RE available to other
> programs).
> 
> Some tools support more than one RE syntax, depending on invocation
> and arguments.
> 
> I don't know which RE tcl supports nowadays. I haven't touched it in
> about 8 years.
> 
> >                                 all the usage for . * ? + / () [] are
> > the same?
> 
> The slash  is not a special character in regular expressions, but it's
> most often used as the delimiter for the operators that take regular
> expressions in tools that do.
> 
> The others should all pretty much act the same, although in some RE
> engines you actually need to escape some of them to make them special.
> 
> You'll have to read the documentation of the tool or language you're
> interested in to find out more.
> 
> 
> Why did you ask this question in a Perl group? Or did you post it
> independently to a bunch of other groups as well?
> 
> Martien


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

Date: Thu, 18 Dec 2003 19:26:39 -0800
From: "David Bruno" <webmaster@lowestdomains.info>
Subject: script works, but shows error
Message-Id: <brtr69$grm$1@daisy.noc.ucla.edu>

Hi,
I'm using this script to copy one directory into another:

#!/usr/bin/perl
$from = "/full/path/to/source";
$to = "/full/path/to/destination";
`cp -R $from $to`;
print "Done";

The directory gets copied, but the browser diplays a 500 error
instead of "Done".  why would this be?

thanks,
David




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

Date: Fri, 19 Dec 2003 04:28:01 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: script works, but shows error
Message-Id: <l7vEb.40012$xO.25937@nwrddc02.gnilink.net>

David Bruno wrote:
> Hi,
> I'm using this script to copy one directory into another:
>
> #!/usr/bin/perl
> $from = "/full/path/to/source";
> $to = "/full/path/to/destination";
> `cp -R $from $to`;
> print "Done";
>
> The directory gets copied, but the browser diplays a 500 error
> instead of "Done".  why would this be?

Please see "perldoc -q 500"

jue




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

Date: Fri, 19 Dec 2003 04:32:37 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: script works, but shows error
Message-Id: <20031218233236.11d30544.jwillmore@remove.adelphia.net>

On Thu, 18 Dec 2003 19:26:39 -0800
"David Bruno" <webmaster@lowestdomains.info> wrote:

> Hi,
> I'm using this script to copy one directory into another:
> 
> #!/usr/bin/perl
> $from = "/full/path/to/source";
> $to = "/full/path/to/destination";
> `cp -R $from $to`;
> print "Done";
> 
> The directory gets copied, but the browser diplays a 500 error
> instead of "Done".  why would this be?

perldoc -q 'cgi'
and
http://www.perl.org/troubleshooting_CGI.html

Read these and if you have any further questions, post them here.

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
"MacDonald has the gift on compressing the largest amount of
words into the smallest amount of thoughts."   -- Winston
Churchill 


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

Date: Fri, 19 Dec 2003 04:43:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: script works, but shows error
Message-Id: <1mvEb.40026$xO.33622@nwrddc02.gnilink.net>

James Willmore wrote:
> perldoc -q 'cgi'
> and
> http://www.perl.org/troubleshooting_CGI.html
>
> Read these and if you have any further questions, post them here.

Actually no. Rather ask in a newsgroup that actually deals with CGI

jue




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

Date: Thu, 18 Dec 2003 23:28:58 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: script works, but shows error
Message-Id: <slrnbu534q.kau.tadmc@magna.augustmail.com>

David Bruno <webmaster@lowestdomains.info> wrote:

> The directory gets copied, but the browser diplays a 500 error
> instead of "Done".  why would this be?


Because you are not outputting any headers.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 18 Dec 2003 15:20:16 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Signaling another machine
Message-Id: <181220031520160619%jgibson@mail.arc.nasa.gov>

In article <a7b604a1.0312180755.5036f568@posting.google.com>,
Palaniappan <palam_analog@yahoo.co.in> wrote:

> Hi all,
> 
> Is there any way to signal another machine?
> 
> My problem is...
> I like to do run a sequence of perl scripts automatically in
> different machines. They should be run one by one in different
> machines in a sequence.
> 
> After completing a script in one machine, how to signal another
> machine to start next script.
> 
> All machines are connected through LAN.
> 
> I know this group discusses mostly about perl coding. but i don't
> have good knowledge about computer networks. so i am looking for
> a perl solution directly, that's why i posted here.. :-)
> 
> -with regards
> palam

The answer to your questions depends a great deal on your operating
system. Try typing "man ssh" and "man rsh" in a command line window. If
your operating system doesn't have a command line window, or it doesn't
respond to either of the above with intelligible information, you have
the wrong operating system and I can't help you. :)

If you do get something readable from the above, then followup with
"perldoc -f system" and "perldoc perlop" (search for 'backtick').


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

Date: Thu, 18 Dec 2003 16:59:47 -0800
From: "Damian" <not_a_real@adress.getting.too.much.spam.org>
Subject: Re: strange results using m//g in while loop...
Message-Id: <brtiea$7g6d2$1@ID-196529.news.uni-berlin.de>

Ben Morrow wrote:
> Brian McCauley <nobull@mail.com> wrote:
>> The number of the last successful capture in the regex is $#- and the
>> total number of captures in the regex is in $#+.
>
> Ouch! These *really* ought to be the same.
>
> I would prefer to write $#+ as @+-1, because $#+ is an ordinal
> while scalar(@+) is a cardinal. This would bite if you were daft
> enough to change $[... :)

Cardinal? What exactly do you mean by that? It seems to make no
difference at all over than cosmetic.




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

Date: Thu, 18 Dec 2003 21:29:13 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: strange results using m//g in while loop...
Message-Id: <slrnbu4s48.k79.tadmc@magna.augustmail.com>

Damian <not_a_real@adress.getting.too.much.spam.org> wrote:
> Ben Morrow wrote:

>> I would prefer to write $#+ as @+-1, because $#+ is an ordinal
>> while scalar(@+) is a cardinal.

> Cardinal? What exactly do you mean by that? 


   http://dictionary.reference.com/search?q=cardinal%20numbers


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Fri, 19 Dec 2003 07:04:11 GMT
From: Erik Tank <jundy@jundy.com>
Subject: Re: ticks and FreeBSD
Message-Id: <2dade0829352763513252b39ad3e83af@news.teranews.com>

I am trying to use Proc::ProcessTable (which I assume you meant
becuase I couldn't find Proc::Table) but I'm not getting any
information.

Program:
#!/usr/bin/perl

use Proc::ProcessTable;
use Data::Dumper;

$t = new Proc::ProcessTable;
print Dumper($t);
__END__

I get the following:
$VAR1 = bless( {}, 'Proc::ProcessTable' );


I've tried this on a FreeBSD 4.9 and 5.1 box and on a Linux RedHat 7.3
box.  

What am I missing?

Thanks,

Erik.  
On Tue, 16 Dec 2003 06:02:35 GMT, James Willmore
<jwillmore@remove.adelphia.net> wrote:

>On Mon, 15 Dec 2003 17:38:49 GMT
>Erik Tank <jundy@jundy.com> wrote:
>
>> I just migrated a program from RedHat 9 to FreeBSD 5.1.  Everything
>> is working well with the exception of the following:
>>   my @jmail_return_lines = `ps -aux | grep 'jmaild' | grep -v grep`;
>> 
>> 
>> The baisc idea is that I want to see if a program called jmaild is
>> running.  On RedHat 9 it @jmail_return_lines would contain the ps
>> -aux lines but under FreeBSD it returns nothing even though when I
>> take the command in the ticks and run it from the command line it
>> does return a line.
>> 
>> Any help or suggestions would be greatly appreciated.
>
>You could look into using a module.. 
>
>Take a look at Proc::Table.
>
>HTH



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

Date: 18 Dec 2003 20:35:34 -0800
From: flateyjarbok@yahoo.com (R Solberg)
Subject: Re: When closing DOS window...
Message-Id: <386cc483.0312182035.4952a59d@posting.google.com>

> One solution could be:
> 
> - create a master Perl script, that runs in the background without a
>    window (use wperl.exe instead of perl.exe)

I would like to learn more about wperl.exe.  Does anyone know of a man
page or something else I can read about wperl.exe?
Thanks.


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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 V10 Issue 5956
***************************************


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