[24890] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7142 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 15 06:06:34 2004

Date: Wed, 15 Sep 2004 03:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 15 Sep 2004     Volume: 10 Number: 7142

Today's topics:
    Re: $| (undocumented) magic? (Anno Siegel)
    Re: a splice question <uri@stemsystems.com>
    Re: a splice question <someone@example.com>
    Re: a splice question <uri@stemsystems.com>
    Re: different behaviour when accessing HD or USB storag <Joe.Smith@inwap.com>
        Emacs modules for Perl programming (Jari Aalto+mail.perl)
    Re: File::Tail Suggestions? <mark.clements@kcl.ac.uk>
    Re: File::Tail Suggestions? <michaeln@twentyten.org>
    Re: hv_iterinit has side effects - who cares about PL t <tassilo.von.parseval@rwth-aachen.de>
    Re: killing a "nobody's" process and its group <usa1@llenroc.ude.invalid>
    Re: killing a "nobody's" process and its group <spamtrap@dot-app.org>
        Looking for a good links manager program <email155@hotmail.com>
    Re: Looking for a good links manager program <spamtrap@dot-app.org>
        Passing a regex reference through a hashed value to the (D.S.)
    Re: Passing a regex reference through a hashed value to (Anno Siegel)
    Re: Passing a regex reference through a hashed value to <nobull@mail.com>
        Perl send args to other perl file. (ilksen)
    Re: rand() question <Joe.Smith@inwap.com>
    Re: Regular expression to match month number 1,...,12 ( (Andres Monroy-Hernandez)
        Speicherkosnum <clandos@yahoo.com>
    Re: upgrading Perl / solaris 5.7 <Joe.Smith@inwap.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 15 Sep 2004 09:39:45 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: $| (undocumented) magic?
Message-Id: <ci92l1$htc$1@mamenchi.zrz.TU-Berlin.DE>

Michael Slass  <miknrene@drizzle.com> wrote in comp.lang.perl.misc:
> Sherm Pendley <spamtrap@dot-app.org> writes:
> 
> >Also, JAPHs as sigs tend to give a bad impression of the language to those
> >who've never seen any other Perl. They promote the idea of an insular
> >community that delights in writing obscure code that's difficult for
> >newbies and outsiders to grok.
> >
> 
> Isn't that the whole point of a JAPH --- to show how clever the owner
> is at writing obscure perl --- and for the puzzle-solving amusement
> of the rest of us, figuring out how/why a particular JAPH works?

A japh doesn't *have* to be obfuscated.  It is _just another_ way
to print that particular string from four lines of sig.

Anno


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

Date: Wed, 15 Sep 2004 04:27:42 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: a splice question
Message-Id: <x7k6uwi2d7.fsf@mail.sysarch.com>

>>>>> "j" == justme  <eight02645999@yahoo.com> writes:

  j> open(FILE, "file.txt") or die "Cannot open file.txt";
  j> print splice @{[<FILE>]}, -10;

  j> supposed to be an implementation of "tail" in perl. The first arg of
  j> splice is supposed to be an array, and i don't know how to interpret
  j> @{[<FILE>]}. Can anyone help to interpret ? thanks

let's break it down from the inside out. <FILE> is just the <>
(readline) operator working on the handle FILE which was just
opened. the next operator is [] which is the anonymous array
constructor. it is initialized with <FILE> which being called in a list
context (inside of []) so it gets all the lines of FILE. then this
anoymous array reference (that is sorta redundant, array (actually all)
refs are always anonymous) is dereferenced with @{} so that splice can
use it. in perl 6, when refs are used in the appropriate list context,
they will automatically be deferenced so this deref won't be needed.

so the result of that expression is a list (it is a array of lines that
will only live in this expression) of the lines in the file that splice
can operate upon. splice then takes the last 10 lines and passes them to
print.

but you could also use File::ReadBackwards:

         use File::ReadBackwards ;

         # Object interface

         my $bw = File::ReadBackwards->new( 'log_file' ) or
                             die "can't read 'log_file' $!" ;
         print map { $bw->readline } 1 .. 10 ;

         # Tied Handle Interface

         tie *BW, File::ReadBackwards, 'log_file' or
                             die "can't read 'log_file' $!" ;

         print map { scalar <BW> } 1 .. 10 ;

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Wed, 15 Sep 2004 05:07:06 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: a splice question
Message-Id: <_5Q1d.8192$yW6.5067@clgrps12>

Uri Guttman wrote:
>>>>>>"j" == justme  <eight02645999@yahoo.com> writes:
> 
>   j> open(FILE, "file.txt") or die "Cannot open file.txt";
>   j> print splice @{[<FILE>]}, -10;
> 
>   j> supposed to be an implementation of "tail" in perl. The first arg of
>   j> splice is supposed to be an array, and i don't know how to interpret
>   j> @{[<FILE>]}. Can anyone help to interpret ? thanks
> 
> [snip]
> 
> so the result of that expression is a list (it is a array of lines that
> will only live in this expression) of the lines in the file that splice
> can operate upon. splice then takes the last 10 lines and passes them to
> print.
> 
> but you could also use File::ReadBackwards:

Or use a list slice (instead of copying the list to an array.)

print +( <FILE> )[ -10 .. -1 ];


John
-- 
use Perl;
program
fulfillment


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

Date: Wed, 15 Sep 2004 05:21:10 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: a splice question
Message-Id: <x7656ghzw3.fsf@mail.sysarch.com>

>>>>> "JWK" == John W Krahn <someone@example.com> writes:

  JWK> Uri Guttman wrote:
  >>>>>>> "j" == justme  <eight02645999@yahoo.com> writes:
  j> open(FILE, "file.txt") or die "Cannot open file.txt";
  j> print splice @{[<FILE>]}, -10;
  j> supposed to be an implementation of "tail" in perl. The first
  >> arg of
  j> splice is supposed to be an array, and i don't know how to interpret
  j> @{[<FILE>]}. Can anyone help to interpret ? thanks
  >> [snip]
  >> so the result of that expression is a list (it is a array of lines
  >> that
  >> will only live in this expression) of the lines in the file that splice
  >> can operate upon. splice then takes the last 10 lines and passes them to
  >> print.
  >> but you could also use File::ReadBackwards:

  JWK> Or use a list slice (instead of copying the list to an array.)

  JWK> print +( <FILE> )[ -10 .. -1 ];

that still reads in the entire file into a list of lines and then slices
it. file::readbackwards never reads more than it needs (it actually does
block i/o so it reads many lines at one time).

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Wed, 15 Sep 2004 09:49:26 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: different behaviour when accessing HD or USB storage
Message-Id: <GeU1d.438135$%_6.292304@attbi_s01>

PilotMI80 wrote:

> When trying to access a USB key with : 
> 
> foreach(<$path/*>)
> (or any combination of quotes )

That is guaranteed to fail if $path contains spaces in the name,
like "e:/My Files".  As you've seen, readdir() does not have
that problem.
	-Joe


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

Date: 15 Sep 2004 04:24:23 GMT
From: <jari.aalto <AT> poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1095222241@rtfm.mit.edu>

Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto A T poboxes com

Announcement: "What Emacs lisp modules can help with programming Perl"

    Preface

        Emacs is your friend if you have to do anything comcerning software
        development: It offers plug-in modules, written in Emacs lisp
        (elisp) language, that makes all your programmings wishes come
        true. Please introduce yourself to Emacs and your programming era
        will get a new light.

    Where to find Emacs/XEmacs

        o   Unix:
            http://www.gnu.org/software/emacs/emacs.html
            http://www.xemacs.org/

        o   Unix Windows port (for Unix die-hards):
            install http://www.cygwin.com/  which includes native Emacs 21.x.
            and XEmacs port

        o   Pure Native Windows port
            http://www.gnu.org/software/emacs/windows/ntemacs.html
            ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe

        o   More Emacs resources at
            http://tiny-tools.sourceforge.net/  => Emacs resource page

Emacs Perl Modules

    Cperl -- Perl programming mode

        http://www.cpan.org/modules/by-authors/id/ILYAZ/cperl-mode/
        http://math.berkeley.edu/~ilya/software/emacs/
        by Ilya Zakharevich

        CPerl is major mode for editing perl files. Forget the default
        `perl-mode' that comes with Emacs, this is much better. Comes
        standard in newest Emacs.

    TinyPerl -- Perl related utilities

        http://tiny-tools.sourceforge.net/

        If you ever wonder how to deal with Perl POD pages or how to find
        documentation from all perl manpages, this package is for you.
        Couple of keystrokes and all the documentaion is in your hands.

        o   Instant function help: See documentation of `shift', `pop'...
        o   Show Perl manual pages in *pod* buffer
        o   Grep through all Perl manpages (.pod)
        o   Follow POD references e.g. [perlre] to next pod with RETURN
        o   Coloured pod pages with `font-lock'
        o   Separate `tiperl-pod-view-mode' for jumping topics and pages
            forward and backward in *pod* buffer.

        o   Update `$VERSION' variable with YYYY.MMDD on save.
        o   Load source code into Emacs, like Devel::DProf.pm
        o   Prepare script (version numbering) and Upload it to PAUSE
        o   Generate autoload STUBS (Devel::SelfStubber) for you
            Perl Module (.pm)

    TinyIgrep -- Perl Code browsing and easy grepping

        [TinyIgrep is included in Tiny Tools Kit]

        To grep from all installed Perl modules, define database to
        TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
        how to set up dattabases for Perl5, Perl4 whatever you have
        installed

        TinyIgrep calls Igrep.el to to do the search, You can adjust
        recursive grep options, set search case sensitivity, add user grep
        options etc.

        You can find latest `igrep.el' module at
        <http://groups.google.com/groups?group=gnu.emacs.sources> The
        maintainer is Jefin Rodgers <kevinr <AT> ihs.com>.

    TinyCompile -- To Browse grep results in Emacs *compile* buffer

        TinyCompile is a minor mode for *compile* buffer from where
        you can collapse unwanted lines or shorten file URLs:

            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT

            -->

            cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
            file1:NNN: MATCHED TEXT
            file1:NNN: MATCHED TEXT

End



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

Date: Wed, 15 Sep 2004 10:20:00 +0200
From: Mark Clements <mark.clements@kcl.ac.uk>
Subject: Re: File::Tail Suggestions?
Message-Id: <4147fb31$1@news.kcl.ac.uk>

Michael wrote:
> I'm analyzing a set of log files, but the files are rotated once they
> reach a certain size:
> 
> Name format:
> access_log_YYYYMMDDHHMM.log
> 
> e.g.
> access_log_200409120143.log
> 
> So what I want the script to do is to read the log, but once it stops
> getting data, to re-scan for the newest file.  Is there a
> value/trigger in
> File::Tail that I can look for?  If not, what would be a good way to
> do this?
Initially I misread your question, and was going to answer that 
File::Tail (to paraphrase) reopens a file automatically if it thinks 
that no more data is being read to it. I subsequently realised that your 
question asks what to do when the new logfile is created with a new 
name: judging by the format I'd guess you're monitoring Apache logfiles 
rotated by rotatelogs.

You could try using the select functionality (marked as experimental) - 
check out the select_demo script from the dist. Start by opening the 
highest numbered logfile and selecting on that. When select times out on 
this file, try instantiating a new File::Tail object on the new 
highest-numbered file, though not if it shares the same name with the 
existing open file. Select on the new File::Tail object and the existing 
one and if you get input on the new object then you can cease selecting 
on the old one.

Mark


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

Date: Wed, 15 Sep 2004 01:34:23 -0700
From: "Michael" <michaeln@twentyten.org>
Subject: Re: File::Tail Suggestions?
Message-Id: <10kfvkihmsrovd7@corp.supernews.com>

"Mark Clements" <mark.clements@kcl.ac.uk> wrote in message
news:4147fb31$1@news.kcl.ac.uk...

[snip]

> Initially I misread your question, and was going to answer that
> File::Tail (to paraphrase) reopens a file automatically if it thinks
> that no more data is being read to it. I subsequently realised that your
> question asks what to do when the new logfile is created with a new
> name: judging by the format I'd guess you're monitoring Apache logfiles
> rotated by rotatelogs.
>
> You could try using the select functionality (marked as experimental) -
> check out the select_demo script from the dist. Start by opening the
> highest numbered logfile and selecting on that. When select times out on
> this file, try instantiating a new File::Tail object on the new
> highest-numbered file, though not if it shares the same name with the
> existing open file. Select on the new File::Tail object and the existing
> one and if you get input on the new object then you can cease selecting
> on the old one.

This sounds like it'd work...  I'll give it a shot.


Michael




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

Date: Wed, 15 Sep 2004 06:26:58 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: hv_iterinit has side effects - who cares about PL theory
Message-Id: <2qpuklF10pjrbU1@uni-berlin.de>

Also sprach Ozgun Erdogan:

[ missing attributes ]

>> I don't think other users of Perl are really aware of the
>> implications of this 'feature'.

I didn't write that. Your quotings should make clearer who wrote which
paragraph.

> At the beginning of this post, you knew that a Perl hash structure
> contains its iterator in it. But you didn't know that Perl has to lock
> down the whole data structure (with a write lock of some sort), even
> if you are doing a hash read/lookup (two prev. posts). Which means,
> you weren't really aware of the implications of this 'feature'.

Well, I just had a glance at the relevant portions of the perl source
and there is virtually no thread-specific code in hv.(c|h). Other than
that, most thread implementations (POSIX threads for instance) don't
know of a 'write lock'. Secure access to shared data happens through
mutexes which are independent of the kind of access (read/write) that
might happen. So the distinction into read and write lock is moot. 

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: 15 Sep 2004 04:19:38 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: killing a "nobody's" process and its group
Message-Id: <Xns956537278F57asu1cornelledu@132.236.56.8>

Sherm Pendley <spamtrap@dot-app.org> wrote in news:GN6dnbI-k9MEztrcRVn-
qQ@adelphia.com:

> A. Sinan Unur wrote:
> 
>> That is gibberish.
> 
> That was rude. Check the originating address - Obviously English is not 
> his first language.

It is not mine either. For the life of me, I cannot figure out what could 
be meant by

>>> The problem is that none kill -9, $cgi_pid or kill $cgi_pid, or kill... 
>>> whatever is able to kill the processes. 

Maybe I should have said "that is gibberish _to_me_". I still do not know 
what the OP meant. Is 

none kill -9, $cgi_pid or kill $cgi_pid, or kill... 

a line in a source file?

I am not trying to be difficult ... I just cannot understand the meaning of 
the statement above.

Sinan.


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

Date: Wed, 15 Sep 2004 01:29:23 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: killing a "nobody's" process and its group
Message-Id: <UsqdnR3slu2pTtrcRVn-qQ@adelphia.com>

A. Sinan Unur wrote:

> Sherm Pendley <spamtrap@dot-app.org> wrote in news:GN6dnbI-k9MEztrcRVn-
> qQ@adelphia.com:
> 
>>Check the originating address - Obviously English is not 
>>his first language.
> 
> 
> It is not mine either.

Seriously? Well, no one's going to accuse you of speaking gibberish. Far 
from it - from what I've read of your posts here, your English is better 
than that of most native speakers.

I see your point though - it can be difficult for a non-native speaker 
to decipher a badly broken sentence. Sorry for the flame.

> For the life of me, I cannot figure out what could 
> be meant by
> 
>>>>The problem is that none kill -9, $cgi_pid or kill $cgi_pid, or kill... 
>>>>whatever is able to kill the processes.

Just for the record, then - I interpreted it by filling in the blanks:

"The problem is that none [of the commands or functions I've tried - 
which are] kill -9, $cgi_pid or kill $cgi_pid, or kill ... whatever [ - 
] is able to kill the [cgi] process [that is running as nobody].

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Tue, 14 Sep 2004 23:57:24 -0400
From: "-" <email155@hotmail.com>
Subject: Looking for a good links manager program
Message-Id: <G4P1d.5307$lb5.649923@news20.bellglobal.com>

Does anyone know of a good perl program that generate static html more like
yahoo style directory?

thanks




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

Date: Wed, 15 Sep 2004 00:18:05 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Looking for a good links manager program
Message-Id: <lO6dnWqyTLDjX9rcRVn-oQ@adelphia.com>

- wrote:

> Does anyone know of a good perl program that generate static html more like
> yahoo style directory?

Have you looked at Bricolage?

<http://bricolage.cc/>

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: 15 Sep 2004 01:15:52 -0700
From: dnjschwantner@integrity.com (D.S.)
Subject: Passing a regex reference through a hashed value to the right side of s///g
Message-Id: <e4bd973.0409150015.feca9c1@posting.google.com>

I have a routine that I reuse alot for data conversion. It reads a tab
seperated list from a driver file into a hash, then reads the target
file and, for each hash combo, does s/key/item/g.

Here is the main part of the code:

while ($input_line = <FILE_IN>) {
    foreach $key_item (sort keys %snr_list) { 
        $input_line =~ s/$key_item/$snr_list{$key_item}/g; 
    }
    print FILE_OUT "$input_line"; 	
}

Works great, except in this case --

I want to pass the s///g a pair (that was read from the driver file
and hashed)that looks like this:

<foo><id>(.*?)<id/><bar>(.*?)<bar/><foo/>	<newtag>$2<newtag/><foo><id>$1<id/><bar>$2<bar/><foo/>

So, what it should do is replace the first string with a new one
prefrixed with <newtag>$2<newtag/>, where $2 would be a the value
found in the <bar> tag.

Well, it doesn't, and to anyone who is smart enough to answer my
problem it should be obvious that it replaces the first string with
the literal value of the second string, not substituing in the
references $1 and $2.

I have tried eval, s///eg, and other combinations. Anyone got a clue
for me??

If this doesn't make sense, I probably should have waited until I got
some sleep to post it :-{

Thanks in advance!!!


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

Date: 15 Sep 2004 09:02:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Passing a regex reference through a hashed value to the right side of s///g
Message-Id: <ci90fv$gcc$1@mamenchi.zrz.TU-Berlin.DE>

D.S. <dnjschwantner@integrity.com> wrote in comp.lang.perl.misc:
> I have a routine that I reuse alot for data conversion. It reads a tab
> seperated list from a driver file into a hash, then reads the target
> file and, for each hash combo, does s/key/item/g.
> 
> Here is the main part of the code:
> 
> while ($input_line = <FILE_IN>) {
>     foreach $key_item (sort keys %snr_list) { 
                         ^^^^
Sorting the keys serves absolutely no purpose.  It's mindless
cargo cult.

>         $input_line =~ s/$key_item/$snr_list{$key_item}/g; 
>     }
>     print FILE_OUT "$input_line"; 	
> }
> 
> Works great, except in this case --
> 
> I want to pass the s///g a pair (that was read from the driver file
> and hashed)that looks like this:
> 
> <foo><id>(.*?)<id/><bar>(.*?)<bar/><foo/>
> <newtag>$2<newtag/><foo><id>$1<id/><bar>$2<bar/><foo/>

A less cluttered example string would make it easier to see what
the problem is.

> So, what it should do is replace the first string with a new one
> prefrixed with <newtag>$2<newtag/>, where $2 would be a the value
> found in the <bar> tag.
> 
> Well, it doesn't, and to anyone who is smart enough to answer my

Thanks for your confidence.

> problem it should be obvious that it replaces the first string with
> the literal value of the second string, not substituing in the
> references $1 and $2.
> 
> I have tried eval, s///eg, and other combinations. Anyone got a clue
> for me??

A single /e has no visible effect when the replacement is interpolated
from a string.  The normal action is to interpolate the string value.
The action with /e is to interpret the replacement ($snr_list{$key_item})
as Perl code (i.e. get its string value) and interpolate that.  No
visible difference.

To make Perl run the content of the interpolated string as code
you need /ee, but then the string must *be* interpretable Perl code.
Just slapping on more e's will take you nowhere.  Change the
replacement string to

    '"<newtag>$2<newtag/><foo><id>$1<id/><bar>$2<bar/><foo/>""'

and try 

    s/$key_item/$snr_list{$key_item}/ee

Anno


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

Date: Wed, 15 Sep 2004 09:53:54 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Passing a regex reference through a hashed value to the right side of s///g
Message-Id: <ci8vmv$ul$1@sun3.bham.ac.uk>

Yes! Yes! Yes! This is wonderfull.  I'm so happy to see this.

I'm currently sitting in the wellcome/keynote session of 
YAPC::Europe::2004.  In the next two days I'm going to give a "Lightning 
Talk" (5 min) on "The history of a FAQ" discussing the various ways of 
asking and answering a particular frequently asked question.  This 
question...

D.S. wrote:
> 
> I want to pass the s///g a pair (that was read from the driver file
> and hashed)that looks like this:
> 
> <foo><id>(.*?)<id/><bar>(.*?)<bar/><foo/>	<newtag>$2<newtag/><foo><id>$1<id/><bar>$2<bar/><foo/>
> 
> So, what it should do is replace the first string with a new one
> prefrixed with <newtag>$2<newtag/>, where $2 would be a the value
> found in the <bar> tag.
> 
> Well, it doesn't, and to anyone who is smart enough to answer my
> problem it should be obvious that it replaces the first string with
> the literal value of the second string, not substituing in the
> references $1 and $2.

See
http://groups.google.com/groups?selm=vr9ueo89hukte0%40corp.supernews.com
http://groups.google.com/groups?selm=u97jybrqdr.fsf%40wcl-l.bham.ac.uk



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

Date: 15 Sep 2004 02:32:42 -0700
From: joericochuyt@msn.com (ilksen)
Subject: Perl send args to other perl file.
Message-Id: <1ab82ae3.0409150132.31d46fc@posting.google.com>

Hello all, 
Can i send vars from file1.pl to file2.pl and display or read the
sended vars in file2.pl? The goal is to communicate between 2 perl
appl. wich are converterd to .exe files.
This is what I have already:
File1
-----------------------------
#!/usr/local/bin/perl
@hello=("test");
@args=("File2.pl", "@hello");
system(@args)==0 or die "system @args failed:$?";

File2
-----------------------------
#!/usr/local/bin/perl
if(@hello){
print "Value: @hello\n";
} else { print "Nothing received\n";}

When executing File1.pl I get the response from File2.pl "Nothing
received".
Tnx for all ur help!


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

Date: Wed, 15 Sep 2004 06:32:25 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: rand() question
Message-Id: <ZlR1d.195554$Fg5.108496@attbi_s53>

daniel kaplan wrote:

> so i generate a serial number with the exact code below (three lines):
> 
> $number1 = 10000 + int(rand(99999));

That creates a number between 10000 and 109999, which can be 6 digits.

> 106421-1023        these last two are six and four digits.....
> 108629-3542

They look like a six digit number with a hyphen and a five or six
digit number where the result has been truncated to 11 characters.

   $result = substr "106421-10230",0,11;  # or "106421-102300"
   $result = substr "108629-35429",0,11;

	-Joe


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

Date: 14 Sep 2004 23:29:29 -0700
From: andres@monroy.com (Andres Monroy-Hernandez)
Subject: Re: Regular expression to match month number 1,...,12 (including e.g. 04,05)
Message-Id: <3591b31a.0409142229.42736ba1@posting.google.com>

mbens@hotmail.com (Matt Benson) wrote in message news:<ci7i5r$c56$00$1@news.t-online.com>...
> How does a regular expression look like which should match exactly one of the
> twelve possible month numbers
> 1,...,12
> Prepending a zero to one-digit month numbers should be allowed e.g. 07
> 
> Matt

Maybe what you want is: 
/^(0?[1-9]|1[0-2])$/


Regards

--
-Andrés Monroy-Hernández


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

Date: Wed, 15 Sep 2004 10:13:50 +0200
From: "Peter" <clandos@yahoo.com>
Subject: Speicherkosnum
Message-Id: <4147f9c0$0$290$4d4ebb8e@read.news.de.uu.net>

Hallo,

folgendes Script kosnumiert Speicher en mass und ich habe keine Ahnung
warum.
Leider lässt sich eine DBI Datenverbindung nicht forken, sodass ich
innerhalb des Childs jedesmal eine Connection öffne.
Allerdings ist es so, das der Speicher nicht mehr freigegeben wird
Hat jemand eine Idee?




use DBI;
while()
{

 if ($pid =fork()) #parent
 {

  wait();

 }
 else # child
 {

  my $dbh = &dbopen;
  print "write data $dbh\n";
  &dbwrite($dbh);
  &dbclose($dbh);
  exit;

 }
}


sub dbopen
{

 my $dsn = 'DBI:mysql:max:server';
 my $db_user_name = 'max';
 my $db_password = 'min';
 my ($id, $password);

 return DBI->connect($dsn, $db_user_name, $db_password);



}

sub dbclose
{
 my $dbh = shift;
 $dbh->disconnect()
}

sub dbwrite
{
 my $dbh = shift;
 $dbh->do("select * from test");
}





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

Date: Wed, 15 Sep 2004 09:37:28 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: upgrading Perl / solaris 5.7
Message-Id: <s3U1d.94140$3l3.27780@attbi_s03>

R McGlue wrote:

> Hi
>   Perl  5.005_02 on the system i want to upgrade to 
> perl_s-5.8.5-sol9-sparc-local.gz are there any issues i need to worry 
> about or can i simply do a pkgadd??

Do not run a sol9-sparc package on a Solaris-7 system.  Use
perl_s-5.8.5-sol7-sparc-local.gz instead.  Then do this:
   mv /usr/bin/perl /usr/bin/perl.sol7
   ln -s /usr/local/bin/perl /usr/bin/perl
   /usr/bin/perl.sol7 -v
   /usr/bin/perl -v

Just don't touch /usr/perl5/bin as system scripts rely on that.
	-Joe


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 7142
***************************************


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