[28873] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 117 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 9 23:11:19 2007

Date: Fri, 9 Feb 2007 20:10:44 -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, 9 Feb 2007     Volume: 11 Number: 117

Today's topics:
        perl 5.8.8 fails to compile <njh@despammed.com>
    Re: perl 5.8.8 fails to compile anno4000@radom.zrz.tu-berlin.de
    Re: perl 5.8.8 fails to compile <njh@despammed.com>
    Re: perl 5.8.8 fails to compile anno4000@radom.zrz.tu-berlin.de
        perl compare function worlman385@yahoo.com
    Re: perl compare function FeelLikeANut@gmail.com
    Re: perl compare function <john@castleamber.com>
    Re: perl compare function <stoupa@practisoft.cz>
        Perl in the comics <mikosullivan@gmail.com>
    Re: Perl in the comics <yuanliixjtu@gmail.com>
    Re: Perl in the comics <richard@zync.co.uk>
    Re: perl one liner to remove all but the base file name <rvtol+news@isolution.nl>
    Re: perl one liner to remove all but the base file name <oxnard@carolina.rr.com>
    Re: perl one liner to remove all but the base file name <kenslaterpa@hotmail.com>
    Re: perl one liner to remove all but the base file name <tadmc@augustmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 07 Feb 2007 09:03:26 GMT
From: Nigel Horne <njh@despammed.com>
Subject: perl 5.8.8 fails to compile
Message-Id: <45c995dd$0$8752$ed2619ec@ptn-nntp-reader02.plus.net>

 ...
`sh  cflags "optimize='-O'" opmini.o`  -DPERL_EXTERNAL_GLOB opmini.c
          CCCMD =  cc -DPERL_CORE -c -O2 -Wall -W -pipe -fno-strict-aliasing -I/usr/local/include -O 
/tmp/perl-5.8.8/opmini.c: In function `Perl_newCONSTSUB':
/tmp/perl-5.8.8/opmini.c:4596: warning: empty body in an if-statement
cc -L/usr/local/lib -o miniperl \
    miniperlmain.o opmini.o libperl.a 
libperl.a(perl.o): In function `Perl_my_unexec':
perl.o(.text+0x45a9): undefined reference to `beos_kill'
libperl.a(util.o): In function `Perl_rsignal':
util.o(.text+0x2ce8): undefined reference to `beos_sigaction'
libperl.a(util.o): In function `Perl_rsignal_state':
util.o(.text+0x2d26): undefined reference to `beos_sigaction'
libperl.a(util.o): In function `Perl_rsignal_save':
util.o(.text+0x2d78): undefined reference to `beos_sigaction'
libperl.a(util.o): In function `Perl_rsignal_restore':
util.o(.text+0x2da3): undefined reference to `beos_sigaction'
libperl.a(util.o): In function `Perl_wait4pid':
util.o(.text+0x2f1a): undefined reference to `beos_waitpid'
libperl.a(doio.o): In function `Perl_apply':
doio.o(.text+0x36bb): undefined reference to `beos_kill'
doio.o(.text+0x3734): undefined reference to `beos_kill'
collect2: ld returned 1 exit status
make: *** [miniperl] Error 1
$


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

Date: 7 Feb 2007 10:20:24 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: perl 5.8.8 fails to compile
Message-Id: <52tnf8F1q13h3U1@mid.dfncis.de>

Nigel Horne  <njh@despammed.com> wrote in comp.lang.perl.misc:
> ...
> `sh  cflags "optimize='-O'" opmini.o`  -DPERL_EXTERNAL_GLOB opmini.c
>           CCCMD =  cc -DPERL_CORE -c -O2 -Wall -W -pipe
> -fno-strict-aliasing -I/usr/local/include -O 
> /tmp/perl-5.8.8/opmini.c: In function `Perl_newCONSTSUB':
> /tmp/perl-5.8.8/opmini.c:4596: warning: empty body in an if-statement
> cc -L/usr/local/lib -o miniperl \
>     miniperlmain.o opmini.o libperl.a 
> libperl.a(perl.o): In function `Perl_my_unexec':
> perl.o(.text+0x45a9): undefined reference to `beos_kill'
> libperl.a(util.o): In function `Perl_rsignal':
> util.o(.text+0x2ce8): undefined reference to `beos_sigaction'
> libperl.a(util.o): In function `Perl_rsignal_state':
> util.o(.text+0x2d26): undefined reference to `beos_sigaction'
> libperl.a(util.o): In function `Perl_rsignal_save':
> util.o(.text+0x2d78): undefined reference to `beos_sigaction'
> libperl.a(util.o): In function `Perl_rsignal_restore':
> util.o(.text+0x2da3): undefined reference to `beos_sigaction'
> libperl.a(util.o): In function `Perl_wait4pid':
> util.o(.text+0x2f1a): undefined reference to `beos_waitpid'
> libperl.a(doio.o): In function `Perl_apply':
> doio.o(.text+0x36bb): undefined reference to `beos_kill'
> doio.o(.text+0x3734): undefined reference to `beos_kill'
> collect2: ld returned 1 exit status
> make: *** [miniperl] Error 1
> $

What system are you on?  If is isn't BeOS something went wrong
during Configure.

Anno


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

Date: 07 Feb 2007 13:36:43 GMT
From: Nigel Horne <njh@despammed.com>
Subject: Re: perl 5.8.8 fails to compile
Message-Id: <45c9d5ea$0$8751$ed2619ec@ptn-nntp-reader02.plus.net>

On Wed, 07 Feb 2007 10:20:24 +0000, anno4000 wrote:

> Nigel Horne  <njh@despammed.com> wrote in comp.lang.perl.misc:
>> ...
>> `sh  cflags "optimize='-O'" opmini.o`  -DPERL_EXTERNAL_GLOB opmini.c
>>           CCCMD =  cc -DPERL_CORE -c -O2 -Wall -W -pipe
>> -fno-strict-aliasing -I/usr/local/include -O 
>> /tmp/perl-5.8.8/opmini.c: In function `Perl_newCONSTSUB':
>> /tmp/perl-5.8.8/opmini.c:4596: warning: empty body in an if-statement
>> cc -L/usr/local/lib -o miniperl \
>>     miniperlmain.o opmini.o libperl.a 
>> libperl.a(perl.o): In function `Perl_my_unexec':
>> perl.o(.text+0x45a9): undefined reference to `beos_kill'
>> libperl.a(util.o): In function `Perl_rsignal':
>> util.o(.text+0x2ce8): undefined reference to `beos_sigaction'
>> libperl.a(util.o): In function `Perl_rsignal_state':
>> util.o(.text+0x2d26): undefined reference to `beos_sigaction'
>> libperl.a(util.o): In function `Perl_rsignal_save':
>> util.o(.text+0x2d78): undefined reference to `beos_sigaction'
>> libperl.a(util.o): In function `Perl_rsignal_restore':
>> util.o(.text+0x2da3): undefined reference to `beos_sigaction'
>> libperl.a(util.o): In function `Perl_wait4pid':
>> util.o(.text+0x2f1a): undefined reference to `beos_waitpid'
>> libperl.a(doio.o): In function `Perl_apply':
>> doio.o(.text+0x36bb): undefined reference to `beos_kill'
>> doio.o(.text+0x3734): undefined reference to `beos_kill'
>> collect2: ld returned 1 exit status
>> make: *** [miniperl] Error 1
>> $
> 
> What system are you on?  If is isn't BeOS something went wrong
> during Configure.

BeOS Professional 5.0

> 
> Anno

-Nigel


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

Date: 7 Feb 2007 13:50:33 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: perl 5.8.8 fails to compile
Message-Id: <52u3p9F1qbe5qU3@mid.dfncis.de>

Nigel Horne  <njh@despammed.com> wrote in comp.lang.perl.misc:
> On Wed, 07 Feb 2007 10:20:24 +0000, anno4000 wrote:
> 
> > Nigel Horne  <njh@despammed.com> wrote in comp.lang.perl.misc:
> >> ...
> >> `sh  cflags "optimize='-O'" opmini.o`  -DPERL_EXTERNAL_GLOB opmini.c
> >>           CCCMD =  cc -DPERL_CORE -c -O2 -Wall -W -pipe
> >> -fno-strict-aliasing -I/usr/local/include -O 
> >> /tmp/perl-5.8.8/opmini.c: In function `Perl_newCONSTSUB':
> >> /tmp/perl-5.8.8/opmini.c:4596: warning: empty body in an if-statement
> >> cc -L/usr/local/lib -o miniperl \
> >>     miniperlmain.o opmini.o libperl.a 
> >> libperl.a(perl.o): In function `Perl_my_unexec':
> >> perl.o(.text+0x45a9): undefined reference to `beos_kill'

[more errors snipped]

> > What system are you on?  If is isn't BeOS something went wrong
> > during Configure.
> 
> BeOS Professional 5.0

BeOS is one of the rarer platforms, so the port may be less thoroughly
tested than others.  You should probably report the problem to p5p.  If
you have a runnable perl, you can use the perlbug command for that.

Anno


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

Date: Wed, 07 Feb 2007 12:59:14 -0800
From: worlman385@yahoo.com
Subject: perl compare function
Message-Id: <tafks294122imuv84b3orutdj3c9c9jntf@4ax.com>

for the code below i got error at line 14
if ( $string1 gt $string2 )
    print "$string1 $string2";

what's the problem?

thanks


print "Enter the first string: ";
$string1 = <STDIN>;
print "Enter the second string: ";
$string2 = <STDIN>;

chomp $string1;
chomp $string2;

if ( $string1 gt $string2 )
    print "$string1 $string2";
elsif  ( $string1 lt $string2 )
    print "$string2 $string1";
elsif  ( $string1 eq $string2 )
    print "$string1\n$string2";

exit;



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

Date: 7 Feb 2007 13:12:56 -0800
From: FeelLikeANut@gmail.com
Subject: Re: perl compare function
Message-Id: <1170882776.455847.266120@l53g2000cwa.googlegroups.com>

On Feb 7, 3:59 pm, worlman...@yahoo.com wrote:
> for the code below i got error at line 14
> if ( $string1 gt $string2 )
>     print "$string1 $string2";
>
> what's the problem?
>
> thanks
>
> print "Enter the first string: ";
> $string1 = <STDIN>;
> print "Enter the second string: ";
> $string2 = <STDIN>;
>
> chomp $string1;
> chomp $string2;
>
> if ( $string1 gt $string2 )
>     print "$string1 $string2";
> elsif  ( $string1 lt $string2 )
>     print "$string2 $string1";
> elsif  ( $string1 eq $string2 )
>     print "$string1\n$string2";
>
> exit;

Perl requires curly braces around even one-lined if statements.

    if ( $string1 gt $string2 ) {
        print "$string1 $string2";
    }



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

Date: 7 Feb 2007 22:01:01 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: perl compare function
Message-Id: <Xns98D0A2EED9796castleamber@130.133.1.4>

worlman385@yahoo.com wrote:

> for the code below i got error at line 14
> if ( $string1 gt $string2 )
>     print "$string1 $string2";
> 
> what's the problem?

You not posting the exact error message...

-- 
John

Installing DBD-mysql with ActiveState Perl
http://johnbokma.com/perl/installing-dbd-mysql-active-state.html


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

Date: Thu, 8 Feb 2007 00:19:55 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: perl compare function
Message-Id: <eqdnd2$i98$1@ns.felk.cvut.cz>

<FeelLikeANut@gmail.com> píse v diskusním príspevku 
news:1170882776.455847.266120@l53g2000cwa.googlegroups.com...
> On Feb 7, 3:59 pm, worlman...@yahoo.com wrote:
>> for the code below i got error at line 14
>> if ( $string1 gt $string2 )
>>     print "$string1 $string2";
>>
>
> Perl requires curly braces around even one-lined if statements.
>
>    if ( $string1 gt $string2 ) {
>        print "$string1 $string2";
>    }
>
Or you can use reverse IF syntax

print "$string1 $string2" if ( $string1 gt $string2 );

-- 

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail 
from another non-spammer site please.)




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

Date: 8 Feb 2007 11:05:59 -0800
From: "snappingturtle" <mikosullivan@gmail.com>
Subject: Perl in the comics
Message-Id: <1170961559.825584.204100@q2g2000cwa.googlegroups.com>

This comic is going up on my cubicle wall:

  http://www.xkcd.com/c208.html

Perl saves the day!



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

Date: 9 Feb 2007 00:57:06 -0800
From: "yuanlii" <yuanliixjtu@gmail.com>
Subject: Re: Perl in the comics
Message-Id: <1171011426.523651.142350@k78g2000cwa.googlegroups.com>

Really funny, thank you for sharing:)

Yuan

On Feb 9, 3:05 am, "snappingturtle" <mikosulli...@gmail.com> wrote:
> This comic is going up on my cubicle wall:
>
>  http://www.xkcd.com/c208.html
>
> Perl saves the day!




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

Date: Fri, 09 Feb 2007 17:04:05 GMT
From: Richard Gration <richard@zync.co.uk>
Subject: Re: Perl in the comics
Message-Id: <pan.2007.02.09.17.04.04.906370@zync.co.uk>

On Fri, 09 Feb 2007 00:57:06 -0800, yuanlii wrote:

> On Feb 9, 3:05 am, "snappingturtle" <mikosulli...@gmail.com> wrote:
>> This comic is going up on my cubicle wall:
>>
>>  http://www.xkcd.com/c208.html
>>
>> Perl saves the day!
>
> Really funny, thank you for sharing:)
> 
> Yuan
> 

Worth taking a while to skim the archive ... there are some laugh out loud
ones there ... more so if you have studied maths at a high level.

-- 
"I want peace on Earth and goodwill toward men."
"We're the United States Government. We don't do that sort of thing."



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

Date: Sat, 3 Feb 2007 09:21:48 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: perl one liner to remove all but the base file name
Message-Id: <eq1kct.13s.1@news.isolution.nl>

Ayaz Ahmed Khan schreef:
> Oxnard:

>> If  I have a file name like:
>>
>> /dkdk888/jdty/file.txt
>>
>> how can I get to just   'file'   using a regex. I have come up with
>
> Alternatively, split() and a little bit of regex can do that easily:
>
>   perl -e '$x = "/some/path/file.ext"; @x = split("\/", $x);
>      $x[-1] =~ s|\..+$||g; print $x[-1];'


A '/' does not need to be escaped. The g-modifier has nothing to do
there.

If names like 'file.1.ext' and 'file.' can be around, I guess
s!\.[^.]*$!! does what is wanted.

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: Sat, 3 Feb 2007 07:34:52 -0500
From: "Oxnard" <oxnard@carolina.rr.com>
Subject: Re: perl one liner to remove all but the base file name
Message-Id: <45c4816e$0$5258$4c368faf@roadrunner.com>


"Abigail" <abigail@abigail.be> wrote in message 
news:slrnes536r.ekq.abigail@alexandra.abigail.be...
> Oxnard (oxnard@carolina.rr.com) wrote on MMMMCMIII September MCMXCIII in
> <URL:news:45c28416$0$16668$4c368faf@roadrunner.com>:
> &&  If  I have a file name like:
> &&
> &&  /dkdk888/jdty/file.txt
> &&
> &&  how can I get to just   'file'   using a regex. I have come up with
> &&  or
> &&  /dkdk/dkdue/dfdf.txt.1234
> &&
> &&  and ending up with 'dfdf'
> &&
> &&  I have come up with  's/^.*\/\([^/]*\)$/\1/' but cannot get rid of the
> &&  extension. Also I have thought about using basename with the suffix 
> but the
> &&  suffix can be different.
>
>
>    s !.*/!!; s !\.[^.]+$!!;
>
>
> Abigail
> -- 
> perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
> .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
> .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
> %$^U;$^V/=$^U}while$^V!=$^W'


What does the !! do ... I cannot find a reference to it.




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

Date: 3 Feb 2007 04:42:14 -0800
From: "kens" <kenslaterpa@hotmail.com>
Subject: Re: perl one liner to remove all but the base file name
Message-Id: <1170506534.431144.321740@k78g2000cwa.googlegroups.com>

On Feb 3, 7:34 am, "Oxnard" <oxn...@carolina.rr.com> wrote:
> "Abigail" <abig...@abigail.be> wrote in message
>
> news:slrnes536r.ekq.abigail@alexandra.abigail.be...
>
>
>
> > Oxnard (oxn...@carolina.rr.com) wrote on MMMMCMIII September MCMXCIII in
> > <URL:news:45c28416$0$16668$4c368faf@roadrunner.com>:
> > &&  If  I have a file name like:
> > &&
> > &&  /dkdk888/jdty/file.txt
> > &&
> > &&  how can I get to just   'file'   using a regex. I have come up with
> > &&  or
> > &&  /dkdk/dkdue/dfdf.txt.1234
> > &&
> > &&  and ending up with 'dfdf'
> > &&
> > &&  I have come up with  's/^.*\/\([^/]*\)$/\1/' but cannot get rid of the
> > &&  extension. Also I have thought about using basename with the suffix
> > but the
> > &&  suffix can be different.
>
> >    s !.*/!!; s !\.[^.]+$!!;
>
> > Abigail
> > --
> > perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
> > .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
> > .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
> > %$^U;$^V/=$^U}while$^V!=$^W'
>
> What does the !! do ... I cannot find a reference to it.


The exclamation mark ( ! ) is being used as the delimter in the
regular expression, rather than the slash ( / ).  Since there is a
slash in the regular expression, it does have to be escaped since
there is a different delimiter making it somewhat easier to read.
Ken



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

Date: Sat, 3 Feb 2007 08:59:29 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: perl one liner to remove all but the base file name
Message-Id: <slrnes98qh.t1e.tadmc@tadmc30.august.net>


[ Please find out how to compose a followup by trimming what you quote.
  If you want to comment on one line, then quote only that one
  line, not 25 lines.
  Please do not quote .sigs.
]


Oxnard <oxnard@carolina.rr.com> wrote:
>
> "Abigail" <abigail@abigail.be> wrote in message 
> news:slrnes536r.ekq.abigail@alexandra.abigail.be...

>>    s !.*/!!;

> What does the !! do ... I cannot find a reference to it.


It is the REPLACEMENT part of the s/PATTERN/REPLACEMENT/ operator,
but using an exclamation point (!) as the demiter instead of slash (/).

Abigail's code above is equivalent to:

   s/.*\///; 

but easier to read and understand because don't have to mentally
filter-out the backslash.


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


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

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 V11 Issue 117
**************************************


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