[19392] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1587 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 22 11:06:30 2001

Date: Wed, 22 Aug 2001 08:05:07 -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: <998492707-v10-i1587@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 22 Aug 2001     Volume: 10 Number: 1587

Today's topics:
    Re: arrays question <philippe.perrin@sxb.bsf.alcatel.fr>
        DBI: Select statements that return results with control <bholness@nortelnetworks.com>
    Re: For loop iterator variable not working correctly?? (Abigail)
    Re: Insert elements into an array <wayne.marrison@consignia.com>
    Re: Insert elements into an array <ilya@martynov.org>
    Re: Insert elements into an array <wayne.marrison@consignia.com>
    Re: Is element in array <cpryce@pryce.net>
    Re: Last index of array referenced in a scalar?? <ren@tivoli.com>
    Re: Perl OO needs the opposite of SUPER:: <ren@tivoli.com>
    Re: Perl PGP routines <fty@mediapulse.com>
        perl4 bashing (was Re: syntax & compilation errors) (Tad McClellan)
        race condition? <jonah@nospam.adtrackz.com>
    Re: race condition? <cpryce@pryce.net>
    Re: race condition? (Tad McClellan)
    Re: Select statements that return results with control  <cpryce@pryce.net>
    Re: syntax & compilation errors (Nomade)
    Re: syntax & compilation errors (Tad McClellan)
    Re: Warning using copy from File::Copy (Nomade)
    Re: Warning using copy from File::Copy <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Weird Formatting Problem <ren@tivoli.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 22 Aug 2001 14:49:10 +0200
From: Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr>
Subject: Re: arrays question
Message-Id: <3B83AA46.7497B0D3@sxb.bsf.alcatel.fr>

Calin Guga wrote:
>     How could I place 2(for ex. @numbers and @dates) or more arrays together
> in a file, array 1 items would go on first row, array 2 items would go on
> second, etc. separated by comma, consecutively?


open(F, "> file.txt") || die;
print F join(",", @numbers) . "\n";
print F join(",", @dates) . "\n";
close(F);

-- 
PhP

($r1,$r2,$r3,$r4)=("19|20","0|1","28|29","5|24");($r5,$r6)=("9|10|15|16|$r1|$r2","9|10|$r3");%h=("1|",$r6,"1=","[1-5]|2[0-4]","1/","0|19","1\\","6|25","2|","0|6|19|25|$r6","2/","1|20","2\\",$r4,"3|","$r2|6|$r1|25|$r6","3/",$r4,"4|","$r2|$r1|$r6","4=","2|3|4|11|12|13|14|21|22|23","4/",$r4,"4\\",15,"5|","$r2|9|15|$r1|20|$r3","5/",10,"6|",$r5,"7|",$r5,"7/",$r3);for($l=1;$l<8;$l++){b:for($i=0;$i<30;$i++){c:foreach(keys
%h){next c if(!(/^$l(.*)$/));$a=$1;if($i=~/^($h{$_})$/){print $a;next
b;}}print " ";}print "\n";}


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

Date: Wed, 22 Aug 2001 14:18:34 +0100
From: "Ben Holness" <bholness@nortelnetworks.com>
Subject: DBI: Select statements that return results with control characters
Message-Id: <9m0bfc$4cg$1@qnsgh006.europe.nortel.com>

Hi all,

I am running a relatively simple perl script that includes the following
lines, located within a loop that increments $ID:

$stmt="SELECT name, description FROM info WHERE id='$ID'";
@array=$dbh->selectrow_array($stmt);
if (!($dbh->errstr))
{
    print "Results - Name: @array[0], \nDescription: \n@array[1]\n";
}

This works for some of the records in the database, but a number of them
have carriage returns (and possibly other control characters) in the
description field. When one of these records is encounted, both Name and
Description become empty.

How can I extract description, preserving the control characters? (i.e. when
it prints I want the formatting to be retained)

Cheers,

Ben




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

Date: 22 Aug 2001 14:32:50 GMT
From: abigail@foad.org (Abigail)
Subject: Re: For loop iterator variable not working correctly??
Message-Id: <slrn9o7gku.6m2.abigail@alexandra.xs4all.nl>

Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMCMXIII
September MCMXCIII in <URL:news:9lvus0$b43$2@mamenchi.zrz.TU-Berlin.DE>:
'' According to Tad McClellan <tadmc@augustmail.com>:
'' > Carlos C. Gonzalez <miscellaneousemail@yahoo.com> wrote:
'' 
'' [...]
''  
'' > If you want real undefs, then you cannot use qw//:
'' > 
'' >    my @new = ( 'harry@tiger.net', undef, undef, 'Russia', undef, undef);
'' 
'' ...or perhaps
'' 
''     my @new;
''     @new[ 0, 3] = qw( harry@tiger.net Russia);
'' 
'' though that doesn't set the length of @new to 6.


But this does:

    @new [0, 3, 5] = qw (harry@tiger.net Russia);



Abigail
-- 
perl -wlne '}for($.){print' file  # Count the number of lines.
#    The fishmonger near
#    a rose bush. A pair of carp
#    dart. Three nesting thrushes.


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

Date: Wed, 22 Aug 2001 14:14:13 +0100
From: "Wayne Marrison" <wayne.marrison@consignia.com>
Subject: Re: Insert elements into an array
Message-Id: <998485984.204472@igateway.postoffice.co.uk>

Ilya Martynov wrote in message <87y9ocl20k.fsf@abra.ru>...
>
>WM> Hi peeps,
>WM> I have another question for you all.
>
>WM> How do I insert an element at  a given point within an array?
>

 .. snip ..

>
>You should look at 'perldoc perlfunc'. In its beging you will find
>list of all functions by category. For example:
>
>       Functions for real @ARRAYs
>           "pop", "push", "shift", "splice", "unshift"
>
>WM> This may be a simple question, and I know I can code it manually, but
given
>WM> Perls excellent array handling, a function to do this kind of thing
must be
>WM> present ...???
>
>You can do it with splice()


Thanks for that, but I have already been looking at splice, and it doesnt
say it does what I want it to do .. I dont really want to have to create
temporary arrays etc ..

Forgive me if Im reading the book (programming perl v3)/pod stuff
incorrectly, but I really am just looking for a simple .. "insert @array,
element number, data" type of command.  If its not present in Perl, then I
will have to resort to the more intricate method.

Thanks for your time.

Wayne






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

Date: 22 Aug 2001 18:07:56 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Insert elements into an array
Message-Id: <87ofp8kx1f.fsf@abra.ru>


>> You can do it with splice()

WM> Thanks for that, but I have already been looking at splice, and it doesnt
WM> say it does what I want it to do .. I dont really want to have to create
WM> temporary arrays etc ..

splice() can be used to insert elements elements into an array.

Example:

    my @arr = (1, 2, 3, 4);
    splice @arr, 2, 0, 'test';
    print "@arr";

prints

     1 2 test 3 4


-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


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

Date: Wed, 22 Aug 2001 15:28:04 +0100
From: "Wayne Marrison" <wayne.marrison@consignia.com>
Subject: Re: Insert elements into an array
Message-Id: <998490408.910236@igateway.postoffice.co.uk>

Excellent.. I didnt see (and still can't) any example in the book that does
that..

Many thanks

Wayne


Ilya Martynov wrote in message <87ofp8kx1f.fsf@abra.ru>...
>
>>> You can do it with splice()
>
>WM> Thanks for that, but I have already been looking at splice, and it
doesnt
>WM> say it does what I want it to do .. I dont really want to have to
create
>WM> temporary arrays etc ..
>
>splice() can be used to insert elements elements into an array.
>
>Example:
>
>    my @arr = (1, 2, 3, 4);
>    splice @arr, 2, 0, 'test';
>    print "@arr";
>
>prints
>
>     1 2 test 3 4
>
>
>--
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>| Ilya Martynov (http://martynov.org/)                                    |
>| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
>| AGAVA Software Company (http://www.agava.com/)                          |
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




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

Date: Wed, 22 Aug 2001 08:31:52 -0500
From: "cp" <cpryce@pryce.net>
Subject: Re: Is element in array
Message-Id: <KsOg7.9380$x84.2845351@ruti.visi.com>

"Pascal Jolin" <pascal.jolin@videotron.ca> wrote in message
news:3B82C339.36B806EF@videotron.ca...
> Happy GREP!!!
>
> my @bla=("one","two","three");
>
> if ( grep {/two/}@bla){
>   print "true";
> } else {
>   print "False";
> }


The reason that I quoted the FAQ that covers this topic (perlfaq4 How can I
tell whether a list or array contains a certain element?) is that grep in
this context is mentioned, and the pitfalls discussed. You should read the
whole FAQ, but since you haven't bothered to yet, I quote the relavent
passage:

" Please do not use

    $is_there = grep $_ eq $whatever, @array;"

" or worse yet


    $is_there = grep /$whatever/, @array;"
" These are slow (checks every element even if the first matches),
inefficient (same reason), and potentially buggy (what if there are regexp
characters in $whatever?). "





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

Date: 22 Aug 2001 08:21:48 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Last index of array referenced in a scalar??
Message-Id: <m3hev0ut5f.fsf@dhcp9-161.support.tivoli.com>

On 22 Aug 2001, anno4000@lublin.zrz.tu-berlin.de wrote:

> According to Ren Maddox  <ren@tivoli.com>:
>  
> [...]
> 
>> "$#" belongs in the same group as "$", "@" and "%".
> 
> In what sense?  In most respects "$#" is fundamentally different
> from "$", "@" and "%": It doesn't correspond to a data type, or a
> slot in a stash entry.  You can't declare a variable that begins
> with "$#" while you can with the others.  "$#" makes only sense in
> conjunction with a corresponding array variable, the others are
> independent of other variables.  Where is the similarity?

Sorry that I didn't provide the context -- I meant syntactically, not
semantically.  That is, it's not an operator or a function or anything
else.

-- 
Ren Maddox
ren@tivoli.com


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

Date: 21 Aug 2001 22:22:05 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Perl OO needs the opposite of SUPER::
Message-Id: <m34rr06aoy.fsf@dhcp9-161.support.tivoli.com>

On 21 Aug 2001, johnlin@chttl.com.tw wrote:

> [Sorry, allow me to reply only partially.  I need more time.]
> 
> Ren Maddox wrote
>> On 20 Aug 2001, John Lin wrote:
>> > Sorry, I meant:
>> > 
>> > sub gen {
>> >     $self->pre_report_in_gen;
>> >     $self->report;
>> >     $self->post_report_in_gen;
>> > }
>> > 
>> > and also
>> > pre_report_in_save_as_html;
>> > post_report_in_save_as_html;
>> > pre_report_in_print_to_printer;
>> > post_report_in_print_to_printer;
>> > ...
>> 
>> That still misses the point.  In your hypothetical VIRTUAL system,
>> you said that all you have to change is the virtual implementation
>> of report().  But if that is true, then in my system all you have
>> to change is the middle-level implementation of pre_report and
>> post_report.  There is no need to create all these extra pre and
>> post calls.
> 
> sub gen {
>     print "Now we are generating report:\n";
>     $self->report;
>     print "Done, hope you like it.\n";
> }
> 
> sub save_as_html {
>     print HTML "<html><pre>\n";
>     $self->report;
>     print HTML "</pre></html>\n";
> }
> 
> sub print_to_printer {

      local *SAVE_STDOUT;
      open SAVE_STDOUT, ">=STDOUT" or die $!;

>     open STDOUT,">=PRN" or die $!;
>     $self->report;
>     close STDOUT;  # Huh?  I'm not sure what to do after the dup is done

Don't close the duped filehandle as that will close the original (PRN)
as well.

      open STDOUT ">=SAVE_STDOUT" or die $!;

> }

It seems that you could solve the problem by separating the down-class
call into a base method that does nothing else.

sub call_report {
    $self->report;
}

Then, you simply override call_report in the intermediate class.  Of
course, this doesn't automatically extend to multiple levels of
intermediate classes.

> The pre-report and post-report are all different codes for each
> caller.  Thus, only pre_report and post_report are not enough.  You
> need pre_report_in_gen, post_report_in_gen,
> pre_report_in_save_as_html, ...
> 
> So I said "you have to find out every spots where it is used/called,
> and re-arrange the caller (gen, save_as_html, etc) into pieces of
> ugly codes."

If the above doesn't solve that problem for 3-levels (admittedly not
for more, though even then I think it is still an improvement), then
I'm still not clear on how the VIRTUAL version would solve it.

>> > Since we want to override the "interface", then orerride it, and
>> > done!!!
>> 
>> Hmm.. that doesn't seem like what you are saying.  You don't want
>> to just override it, you want to interpose the new method in such a
>> way that the original method is still called.
> 
> Yes!!!  Every sample I post here, as well as my problem in real case
> are all "the middle layer interposes, and still call the original
> method", just as you say.  You are the one who understand my
> question most and best.
> 
> I think it is one typical type of programming in polymorphism, so I
> ask here.  But if you think all this kind of programming can be
> avoided or converted into other types, I will still accept.  But
> how?

I'd still like to see this implemented in some language that does
support the construct.  I think it would help our understanding.

> Hmm... the only feasible solution up to now is your pre-post method.
> (The "renaming" is not a solution because it doesn't work.)  But it
> is still too much effort and messy re-writing.  Not clean enough to
> me.

I believe my new suggestion is superior to my previous pre-post method.
It does still suffer from the renaming problem if multiple levels are
to be used (ExtendedReport overrides call_report to call
extended_call_report, so that any additional intermediate classes can
choose to override either call_report or extended_call_report,
depending on the desired behavior), but I think that actually ends up
providing extra flexibility.  I can expand on this if it is not clear.

-- 
Ren Maddox
ren@tivoli.com


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

Date: Wed, 22 Aug 2001 13:25:09 GMT
From: "Jay Flaherty" <fty@mediapulse.com>
Subject: Re: Perl PGP routines
Message-Id: <VoOg7.105841$ai2.7339132@bin2.nnrp.aus1.giganews.com>


"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3B836FD0.1EE4DA74@earthlink.net...
> Jay Flaherty wrote:
> > Wrong. Crypt::OpenPGP is a pure-Perl implementation of the OpenPGP
standard
> > (RFC2440). You still need the PGP software to encrypt/decrypt files.
>
> He doesn't want to encrypt files, he wants to send email containing
> encrypted data.
>
> my $ciphertext = $pgp->encrypt(
> Data => $plaintext,
> KeyID => $key_id,
> Armour => 1,
> );

This encrypts data. So...He wants to encrypt data *AND* send email. His
problem is his ISP wont install PGP and he is looking for a pure perl
solution. There is none. You still need to install PGP to PGP encode data.

jay




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

Date: Wed, 22 Aug 2001 09:35:58 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: perl4 bashing (was Re: syntax & compilation errors)
Message-Id: <slrn9o7d9u.36c.tadmc@tadmc26.august.net>

Nomade <lcamargo@vesper.com.br> wrote:
>tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9o29i6.qk0.tadmc@tadmc26.august.net>...
>> Ilya Martynov <ilya@martynov.org> wrote:

>> >which bundle Perl 4 with their OS.

>>You are using a dead, flea-bitten camel carcass perl.

>That one was good...


It was taken directly from the FAQ answer that I referenced.


I like this one that Randal posted about a year ago,
Message-ID: <m1u2painfh.fsf@halfdome.holdit.com>

---------------------------------------------
OP> What's a good reference to understand the differences between
OP> PERL4 and PERL5?

One of them is a language with a 2-million-plus-and-growing user
community, actively supported, commercial support available, invoked
thousands of times per second in applications worldwide, actively
being developed and expanded, with a huge online repository of useful
ready-to-use scripts, modules, and ports to nearly anything that has a
CPU, supporting programming in the large, object-oriented programming,
interface to C and other languages, with worldwide corporate and
open-enrollment trainings available.

The other is an ancient, dead, not-to-be-used, unsupported,
CERT-notified-security-bugridden ancient version of a language that
helped the web get its start, and sysadms get their job done faster,
but is now abandoned by anyone in the know.

I'll let you figure out which is which. :)

p.s.: bigger clue stick: don't use Perl4.  It's dead.  5 years dead.
The *only* Perl is Perl 5.  5.005_03 preferably.
---------------------------------------------


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


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

Date: Wed, 22 Aug 2001 09:51:36 -0700
From: "Jonah Klimack" <jonah@nospam.adtrackz.com>
Subject: race condition?
Message-Id: <5KOg7.305$mR3.79200@newsfeed.slurp.net>

I have a website in which members can
modify their information in a database.
(flat file text database)

My code currently does this:

#start pseudo
open file
lock file (shared)
load file contents into an array
close file

splice out user's old entry from the array
push user's new info (from the form) on to the end of the array

open file
lock file (exclusive)
print new array to file (overwriting contents of file)
close file
#end pseudo

Last night, my database got corrupted somehow.
It's been running just fine for 8 months, with over 8500 members.
I'm blaming it on this bit of code.
All the other scripts that interact with the database do read
only, or print on to the end of it. I always make sure to
lock exclusive when printing, and shared when reading.

I think I should be keeping a lock on the file during
this whole procedure of modifying a user's entry in the
database because if multiple instances of
this code are running into the same time, I'm sure I can run into problems.

Is there a more efficient way of modifying user's data?
I've thought of looping through the file while holding the
lock but I can't manipulate and save the data at the
same time... or can I?

Thanks for your help.







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

Date: Wed, 22 Aug 2001 09:10:49 -0500
From: "cp" <cpryce@pryce.net>
Subject: Re: race condition?
Message-Id: <g1Pg7.9392$x84.2847750@ruti.visi.com>


"Jonah Klimack" <jonah@nospam.adtrackz.com> wrote in message
news:5KOg7.305$mR3.79200@newsfeed.slurp.net...
> I have a website in which members can
> modify their information in a database.
> (flat file text database)
>
> My code currently does this:
>
> #start pseudo
> open file
> lock file (shared)
> load file contents into an array
> close file
>
> splice out user's old entry from the array
> push user's new info (from the form) on to the end of the array
>
> open file
> lock file (exclusive)
> print new array to file (overwriting contents of file)
> close file
> #end pseudo
>

See the FAQ : How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the beginning of a
file?

perldoc perlfaq5

or:
perldoc -q file

Briefly, the technique outlined there is:

open oldfile (readonly)
open newfile (create|write)

while (<oldfile>) {
    # change the lines that need changing, leave the lines that don't
    print each line to the new file
}

close old
close new
rename old -> old.bak
rename new to old

This can be easier on your system if the database file is large. With this
method, you don't have to suck the whole file into an array. And this method
creates a backup file for you.

Another technique using flocking is discussed in Randal Schwartz's Web
Techniques column:
http://www.stonehenge.com/merlyn/WebTechniques/col04.html

cp




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

Date: Wed, 22 Aug 2001 10:08:27 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: race condition?
Message-Id: <slrn9o7f6r.36c.tadmc@tadmc26.august.net>

Jonah Klimack <jonah@nospam.adtrackz.com> wrote:
>I have a website in which members can
>modify their information in a database.
>(flat file text database)
>
>My code currently does this:
>
>#start pseudo
>open file
>lock file (shared)
>load file contents into an array
>close file
>
>splice out user's old entry from the array
>push user's new info (from the form) on to the end of the array
>
>open file
>lock file (exclusive)
>print new array to file (overwriting contents of file)
>close file
>#end pseudo
>
>Last night, my database got corrupted somehow.


The race condition you describe above is the "somehow", as
you seem to have already deduced:

   A does the shared lock

   B does the shared lock

   B does the exclusive lock (adds a record, say)

   A does the exclusive lock (adds a record, say)
   
The record that B added is lost.


>It's been running just fine for 8 months, with over 8500 members.


That's the problem with a race. It works fine until the timing
works out "just right".


>I'm blaming it on this bit of code.


You are correct.


>I think I should be keeping a lock on the file during
>this whole procedure of modifying a user's entry in the
>database because if multiple instances of
>this code are running into the same time, I'm sure I can run into problems.


Right.


>Is there a more efficient way of modifying user's data?
                 ^^^^^^^^^

What kind of efficieny?

Speed? Memory? Programmer's development time? Programmer's maintenance time?


>I've thought of looping through the file while holding the
>lock but I can't manipulate and save the data at the
>same time... or can I?


If you can comfortably hold the entire file in memory, as your
pseudo code implies, then you can easily:

open() for read/write
flock(LOCK_EX)
read into memory
do stuff
truncate() and seek() to beginning of file
write from memory
close()


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


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

Date: Wed, 22 Aug 2001 09:11:19 -0500
From: "cp" <cpryce@pryce.net>
Subject: Re: Select statements that return results with control characters
Message-Id: <K1Pg7.9393$x84.2847756@ruti.visi.com>


"Ben Holness" <bholness@nortelnetworks.com> wrote in message
news:9m0bfc$4cg$1@qnsgh006.europe.nortel.com...
> Hi all,
>
> I am running a relatively simple perl script that includes the following
> lines, located within a loop that increments $ID:
>
> $stmt="SELECT name, description FROM info WHERE id='$ID'";
> @array=$dbh->selectrow_array($stmt);
> if (!($dbh->errstr))
> {
>     print "Results - Name: @array[0], \nDescription: \n@array[1]\n";
> }
>
> This works for some of the records in the database, but a number of them

I'm not sure that it is the source of your problem, however, @array[0] is an
array slice. I belive what you wanted to say was $array[0] and $array[1].
You could also assign the selectrow_array to a list:

my ($name, $descritption) = selectrow_array($stmt);
# and then condense the error check
print "Results - Name: $name\nDescription: \n$description\n" unless
$dbh->errstr();


cp




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

Date: 22 Aug 2001 06:11:36 -0700
From: lcamargo@vesper.com.br (Nomade)
Subject: Re: syntax & compilation errors
Message-Id: <39dc7e6e.0108220511.5e14bc2d@posting.google.com>

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9o29i6.qk0.tadmc@tadmc26.august.net>...
> Ilya Martynov <ilya@martynov.org> wrote:
> 
> >I heard on one maillist that there are still exist some Unix vendors
> >which bundle Perl 4 with their OS.
> 
> 
> You don't have to look very hard to find fools in the world.
> 
> :-(
> 
> 
> An OS vendor that ignores CERT advisories should be put on
> your personal blacklist.


>You are using a dead, flea-bitten camel carcass perl.
That one was good...

i´m usin the perl that came with my os (AIX 4.3.3)...

blame IBM :))

thnx

Nomade


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

Date: Wed, 22 Aug 2001 09:51:43 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: syntax & compilation errors
Message-Id: <slrn9o7e7f.36c.tadmc@tadmc26.august.net>

Nomade <lcamargo@vesper.com.br> wrote:
>tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9o29i6.qk0.tadmc@tadmc26.august.net>...

>> >I heard on one maillist that there are still exist some Unix vendors
>> >which bundle Perl 4 with their OS.
>> 
>> You don't have to look very hard to find fools in the world.


>i´m usin the perl that came with my os (AIX 4.3.3)...


If what is supplied isn't what you need, then you have extra work
to do. You go get what you need.

I think it is possible to upgrade, even on AIX? Contact your sysadmin.

What if they supplied no perl at all? Would you not use perl, or
would you go get perl?

If you then went to get perl, would you get the one released
in 1993 (when most PCs had Windows 3.1 on them), or would
you get a contemporary release?


>blame IBM :))


I'm not the one who cannot get any assistance with the software supplied.
I don't have a problem, so I don't need anyone to blame  :-)

_You_ blame IBM for being met with derision and/or silence when
you need some outside help.


The big problem with sticking with perl4 is that you are 
All Alone (sans Our Troll).


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


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

Date: 22 Aug 2001 06:09:10 -0700
From: lcamargo@vesper.com.br (Nomade)
Subject: Re: Warning using copy from File::Copy
Message-Id: <39dc7e6e.0108220509.717aa25f@posting.google.com>

Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote in message news:<3B81FB52.7020700@post.rwth-aachen.de>...
> Nomade wrote:
> 
> > Hi all
> > 
> > I do a foreach loop in an array with file names, for each one i have
> > to copy to some other place, but after the 2nd interarion of the loop
> > i get the following message :
> > 
> > Use of uninitialized value at /usr/lpp/ssp/perl5/lib/File/Copy.pm line
> > 84.
> > 
> > 
> > However, all files get copied with no major problems...
> > 
> > But how can i avoid that message ????
> 
> It is a warning hence you could add a signalhandler for that.
> 
> $SIG{__WARN__} = sub { }; # will make them vanish
> 
> see 'perldoc -q undefined.*variables' for a bit on that.
> 
> 
> Tassilo


Thnx Tassilo,

It worked with no problems..
I think i get this message bcoz the old version of perl i´m usin...

Nomade


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

Date: Wed, 22 Aug 2001 15:18:08 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Warning using copy from File::Copy
Message-Id: <3B83B110.2080306@post.rwth-aachen.de>

Nomade wrote:

> It worked with no problems..
> I think i get this message bcoz the old version of perl i´m usin...

Not sure. I heard that 5.6.0 was throwing particularly many warnings. 
Allegedly this got better with 5.6.1.

By the way: If your script is not supposed to be portable, you could use 
system instead of File::Copy. I guess it would be quicker than the 
File::Copy module.

system "cp $file $destination" && warn "Something did not work";
Tassilo

-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



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

Date: 21 Aug 2001 23:19:14 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Weird Formatting Problem
Message-Id: <m3zo8s4th9.fsf@dhcp9-161.support.tivoli.com>

On Sat, 18 Aug 2001, glob@cableone.net wrote:

> 
> Im trying to write a somewhat suppossed to be simple script that:
> 
> Uses File::Find to recursivley scan the directorys, and outputs sort
> of a "visual" ls, i.e.
> 
> +SomeDir
>         -Somefile
>         -Somefile2
>         +SomeDir
>                 -AnotherFile

Use this as the wanted sub:

sub { print "  " x $File::Find::name =~ tr|/||, -d $_ ? "+" : "-", "$_\n"; }

Note that it is OS-specific, but I believe it works fine for both UNIX
and DOS (but probably not Mac or VMS).

-- 
Ren Maddox
ren@tivoli.com


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

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


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