[28223] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9587 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 10 11:05:44 2006

Date: Thu, 10 Aug 2006 08:05:06 -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           Thu, 10 Aug 2006     Volume: 10 Number: 9587

Today's topics:
    Re: 50+ bits of arithmetic in a 32-bit bag mailbox@cpacker.org
    Re: 50+ bits of arithmetic in a 32-bit bag anno4000@radom.zrz.tu-berlin.de
    Re: @_ deprecated? anno4000@radom.zrz.tu-berlin.de
    Re: LWP seems to hang <mike.smith@amd.com>
    Re: Need help with parsing data <Shani718@gmail.com>
    Re: Net FTP -- Size showing different results on AIX sy <fmbright@gmail.com>
    Re: OO Perl : Struggling with hash data members in my C <Brett.R.Davis@gmail.com>
        Pattern matching in perl praveen.kantharajapura@gmail.com
    Re: Pattern matching in perl <josef.moellers@fujitsu-siemens.com>
    Re: Pattern matching in perl <1usa@llenroc.ude.invalid>
    Re: Pattern matching in perl <jurgenex@hotmail.com>
    Re: Pattern matching in perl <glennj@ncf.ca>
    Re: Pattern matching in perl <tadmc@augustmail.com>
        POST data truncated in a cgi application timnels@gmail.com
    Re: POST data truncated in a cgi application <1usa@llenroc.ude.invalid>
    Re: POST data truncated in a cgi application timnels@gmail.com
    Re: POST data truncated in a cgi application <bart@nijlen.com>
        regex and utf8 characters (german umlauts) <ext-dirk.heinrichs@nokia.com>
    Re: regex and utf8 characters (german umlauts) <daveandniki@ntlworld.com>
    Re: regex and utf8 characters (german umlauts) <ext-dirk.heinrichs@nokia.com>
        Sorting integers in perl praveen.kantharajapura@gmail.com
    Re: Sorting integers in perl <jurgenex@hotmail.com>
    Re: Sorting integers in perl gkarpo@gmail.com
    Re: ||== ,&&== ,|= ,&= anno4000@radom.zrz.tu-berlin.de
    Re: ||== ,&&== ,|= ,&= <bik.mido@tiscalinet.it>
    Re: ||== ,&&== ,|= ,&= <sujay.tukai@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 10 Aug 2006 05:41:33 -0700
From: mailbox@cpacker.org
Subject: Re: 50+ bits of arithmetic in a 32-bit bag
Message-Id: <1155213693.817792.14090@b28g2000cwb.googlegroups.com>


xhoster@gmail.com wrote:
> On my machine, your test also passes for 55, but a more rigorous test
> does not:
>
> $ perl -le '$foo=55; print((2**$foo+30)-(2**$foo+25))'
> 8
>
> I'm pretty sure that 5 != 8, so 55 bits is right out.  On my machine, 52 is
> high as I would go.
>
> $ perl -le '$foo=52; foreach (1..1e7) { my $y =
> ((2**$foo+$_+1)-(2**$foo+$_));
>             die $_ unless $y == 1}'


Thanks for that improvement! It behaves the same on our machine as on
yours. Fortunately,  52 bits is still plenty of magnitude for our
purposes.

--
Charles Packer
mailboxATcpacker.org 
http://cpacker.org/whatnews



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

Date: 10 Aug 2006 12:55:28 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: 50+ bits of arithmetic in a 32-bit bag
Message-Id: <4k0om0F9t22tU1@news.dfncis.de>

 <xhoster@gmail.com> wrote in comp.lang.perl.misc:
> mailbox@cpacker.org wrote:
> > Our implementation of Perl under AIX
> > doesn't support 64-bit integer arithmetic;
> > so says "perl -V".
> >
> > A search of these newsgroups turned up a
> > test of this fact as follows:
> >
> > $two += 2;
> > $x = $two ** 63 + 25;
> > $y = $two ** 63 + 30;
> > if($x == $y) {print "64 bits not supported\n"}
> > else {print "64 bits supported\n"}
> >
> > I found that it would give an affirmative
> > result if I used up to 55 instead of 63.
> > This suggests that a floating-point
> > format with a seven-byte fraction is
> > being invoked. Perhaps that's the native
> > floating-point of the AIX box?
> > At any rate, barring followups to the
> > contrary, I'll assume that I can treat
> > our Perl as having a 55-bit integer
> > arithmetic capability for accumulating
> > sums, at least.
> 
> That is a poor assumption.  Just because the $x and $y are not identical
> does not mean that they are what they are supposed to be.
> 
> On my machine, your test also passes for 55, but a more rigorous test
> does not:
> 
> $ perl -le '$foo=55; print((2**$foo+30)-(2**$foo+25))'
> 8
> 
> I'm pretty sure that 5 != 8, so 55 bits is right out.  On my machine, 52 is
> high as I would go.
> 
> $ perl -le '$foo=52; foreach (1..1e7) { my $y =
> ((2**$foo+$_+1)-(2**$foo+$_));
>             die $_ unless $y == 1}'

That happens to coincide with the 53 bit mantissa in IEEE-something
floats.  One bit is the sign bit, so 52 bits are safe.

Anno


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

Date: 10 Aug 2006 12:03:07 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: @_ deprecated?
Message-Id: <4k0ljrFa1nfgU1@news.dfncis.de>

John Bokma  <john@castleamber.com> wrote in comp.lang.perl.misc:
> "broeisito@gmail.com" <broeisito@gmail.com> wrote:

[...]

> > while(<CPU>)
> > {
> >      if(/model.name/)
> >      {
> >           split;
> 
> The problem is here, you split to @_, which is deprecated, see:
> perldoc -f split
> 
> >           print "The processor is an $_[3] $_[4] $_[5] running at
> >           $_[7]\n"; 
> >      }
> > }
> 
> I would do the while loop like:
> 
> while ( my $line = <$fh> ) {
> 
>     	$line =~ /model\.name/ or next;
> 
>     	my @data = split /\s+/, $line;    	# not sure about the pattern
>     	print "The processor ..   $data[ 0 ] $data[ 1 ] ...\n";
> }
> 
> close $fh or die "Can't close '$CPU_FILE' after reading: $!";

I'd prefer to use significant names instead of the data array
(untested):

    my ( $make, $model, $type, $speed) = (split)[ 3, 4, 5, 7];
    print "The processor is a $make $model $type running at $speed\n";

Anno


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

Date: 10 Aug 2006 07:07:04 -0700
From: "masmith27" <mike.smith@amd.com>
Subject: Re: LWP seems to hang
Message-Id: <1155218824.180238.294970@75g2000cwc.googlegroups.com>

Hello,
Thanks for the response. I have made the changes you suggested, but
still no change. You have reminded me that I forgot to mention a couple
things in my first post though. When I said the timeout has no response
I meant that including the timeout statement does not change the script
at all, changing the number inside has no change either, 15 was just
the last value I had tried. I also forgot to mention that I have tried
getting this website with SSL enabled and with SSL disabled since the
website does not require SSL but I have left it enabled due to some
details of the project I am working on. SSLeay is also installed.


John Bokma wrote:
> "masmith27" <mike.smith@amd.com> wrote:
>
> > #!/usr/bin/perl -w
>
> remove the -w
>
> add:
>
> use strict;
> use warnings;
>
> > use LWP;
> > use HTTP::Cookies;
> >
> > my $browser = LWP::UserAgent->new;
> >
> > $browser->timeout("15");
>
> 15 is a number, why do you use "" ?
>
> > $browser->cookie_jar( HTTP::Cookies->new('file' => '/tmp/cookies.lwp',
> >     'autosave' => 1,
> > ));
>
> note that the '' around file and autosave are not needed thanks to some
> magic => does to the LHS.
>
> > push @{ $browser->requests_redirectable }, 'POST';
> >
> > $url = 'https://127.0.0.1:2381/webpage.php
>
> my $url = ....
>
> > $response = $browser->get($url);
>
> my $response = ...
>
> > die "Can't get $url -- ", $response->status_line unless
> > $response->is_success;
>
> I prefer:
>
> $response->is_success or
>     	die " ...... ";
>
> Which I read as: for the next steps it's important that the response is
> successfull, otherwise we die.
>
>
> The "15" might be the cause of your timeout not working.
>
> Also note that you need support for https installed (Crypt::SSLeay for
> example) but I assume you have that installed otherwise LWP would
> complain.
>
> --
> John Bokma          Freelance software developer
>                                 &
>                     Experienced Perl programmer: http://castleamber.com/



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

Date: 10 Aug 2006 06:48:23 -0700
From: "Shan" <Shani718@gmail.com>
Subject: Re: Need help with parsing data
Message-Id: <1155217703.579615.167600@i3g2000cwc.googlegroups.com>

Thanks for your advice. i will work on writing a script today and see
what kind of results I get.



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

Date: 10 Aug 2006 07:08:11 -0700
From: "fmbright" <fmbright@gmail.com>
Subject: Re: Net FTP -- Size showing different results on AIX system and Linux system
Message-Id: <1155218891.625602.184190@i42g2000cwa.googlegroups.com>

Hi Len,

I get the correct filesizes when I do an ftp from both boxes.  And when
I do a windows FTP to the site.

FMB

l v wrote:
> fmbright wrote:
> > Len,
> >
> > I installed the latest copies from CPAN and installed the lastest
> > version of Perl on both boxes.  Could the different unixes make
> > different results??
> >
> > Thanks!
> >
> > Frank
> >
> > l v wrote:
> >
> >>fmbright wrote:
> >>
> >>>To All:
> >>>
> >>>This is my first post.  My name is Frank.  I have been using  Net FTP
> >>>to create an automated FTP process.  I developed it on an AIX box (AIX
> >>>5.2.0.7)  and now want to move it to our Linux box (Redhat).  The size
> >>>subroutine gives different results when running on the AIX version
> >>>Linux box.  On the AIX the size functions returns the size of the file
> >>>on the FTP while the call on the Linux box returns undefined.
> >>>
> >>>I am calling the same FTP site each time and using the same version of
> >>>the script.  What else would need to be done to get these version in
> >>>sync??
> >>>
> >>>Thanks!
> >>>
>
> I don't know.  What file sizes do you get when you use native ftp
> clients on each box?
> -- 
> 
> Len



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

Date: 10 Aug 2006 05:36:29 -0700
From: "Brett.R.Davis@gmail.com" <Brett.R.Davis@gmail.com>
Subject: Re: OO Perl : Struggling with hash data members in my Class
Message-Id: <1155213388.931352.37390@75g2000cwc.googlegroups.com>

OK - it worked!

I am a moron, and didn't have "-w" set in the script so I didn't notice
that I had { } around a hash reference like you said in the above post.
  I originally had it as an anonymous hash.

By changing the return statement and fixing my hash declaration (used (
) instead of { }  ) - it works!

Thank you

Brett

Mumia W. wrote:
> On 08/09/2006 10:49 PM, Brett.R.Davis@gmail.com wrote:
> > You said that you were able to get my original code to work.
> >
> > Can you tell me specifically what it was - or was it the items you
> > specified in the message?
> > [...]
>
> Don't top post.
>
> Everything was in the message: I assigned $color_set to
> $chash, and I made my_colors() return $self->{MY_COLORS}.



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

Date: 10 Aug 2006 06:25:17 -0700
From: praveen.kantharajapura@gmail.com
Subject: Pattern matching in perl
Message-Id: <1155216317.344840.20110@i3g2000cwc.googlegroups.com>

Hi all,

I have a file now i need to search for two strings "string1" and
"string2" in the same line.If both of them occur in the same line
increment a counter else do not.

How to go about doing this in perl??

Regards,
Praveen



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

Date: Thu, 10 Aug 2006 15:32:12 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Pattern matching in perl
Message-Id: <ebfco2$d98$1@nntp.fujitsu-siemens.com>

praveen.kantharajapura@gmail.com wrote:
> Hi all,
>=20
> I have a file now i need to search for two strings "string1" and
> "string2" in the same line.If both of them occur in the same line
> increment a counter else do not.
>=20
> How to go about doing this in perl??

Try it?

--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: Thu, 10 Aug 2006 13:44:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Pattern matching in perl
Message-Id: <Xns981B63275A9A6asu1cornelledu@127.0.0.1>

praveen.kantharajapura@gmail.com wrote in news:1155216317.344840.20110
@i3g2000cwc.googlegroups.com:

> I have a file now i need to search for two strings "string1" and
> "string2" in the same line.If both of them occur in the same line
> increment a counter else do not.
> 
> How to go about doing this in perl??

perldoc -f index

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



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

Date: Thu, 10 Aug 2006 13:46:23 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Pattern matching in perl
Message-Id: <PMGCg.85166$Lh4.24006@trnddc02>

praveen.kantharajapura@gmail.com wrote:
> I have a file now i need to search for two strings "string1" and
> "string2" in the same line.If both of them occur in the same line
> increment a counter else do not.
>
> How to go about doing this in perl??

Which part is the problem?
    - the check if a string is contained in another string? See 'perldoc -f 
index'
    - to combine two conditions? See 'perldoc perlop', operator 'and'
    - to create a if clause? See 'perldoc perlsyn', and then the if 
statement in section compound statements
    - to increment a counter? See 'perldoc perlop', operator +=
    - to do nothing? Well, ....

jue 




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

Date: 10 Aug 2006 13:47:23 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: Pattern matching in perl
Message-Id: <slrnedme7b.6cv.glennj@smeagol.ncf.ca>

At 2006-08-10 09:25AM, praveen.kantharajapura@gmail.com <praveen.kantharajapura@gmail.com> wrote:
>  Hi all,
>  
>  I have a file now i need to search for two strings "string1" and
>  "string2" in the same line.If both of them occur in the same line
>  increment a counter else do not.


    $counter++ if /string1/ and /string2/;
or
    $counter++ if /^(?=.*?string1)(?=.*?string2)/;



-- 
Glenn Jackman
Ulterior Designer


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

Date: Thu, 10 Aug 2006 08:41:03 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Pattern matching in perl
Message-Id: <slrnedmdrf.ufk.tadmc@magna.augustmail.com>

praveen.kantharajapura@gmail.com <praveen.kantharajapura@gmail.com> wrote:

> I have a file 


   perldoc -f open


> now i need to search for two strings "string1" and
> "string2" in the same line.


You would write a pattern match to do that.

   perldoc -f m


> If both of them occur in the same line


See the && operator, also in perlop.pod.


> increment a counter else do not.


   $counter++;


> How to go about doing this in perl??


See above.


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


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

Date: 10 Aug 2006 05:36:33 -0700
From: timnels@gmail.com
Subject: POST data truncated in a cgi application
Message-Id: <1155213393.018278.241120@i42g2000cwa.googlegroups.com>

I have what I thought was a simple CGI application which takes a POST
of a jpeg image from a Nextel phone (creates an HTTP request with
content type image/jpeg).

The CGI app seems (even though the phone sends more data) ALWAYS to
receive 8440 bytes.  The code to receive this data is:

use CGI;
use CGI::Carp qw(fatalsToBrowser);

my ($data,@args);

$data = join '',<>;

# right here length($data) is always 8440.

I looked for an Apache setting that might be causing this, but I didn't
see anything.  Can anyone point me in the right direction ?  Thanks.



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

Date: Thu, 10 Aug 2006 13:43:03 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: POST data truncated in a cgi application
Message-Id: <Xns981B62F2E3A07asu1cornelledu@127.0.0.1>

timnels@gmail.com wrote in news:1155213393.018278.241120
@i42g2000cwa.googlegroups.com:

> I have what I thought was a simple CGI application which takes a POST
> of a jpeg image from a Nextel phone (creates an HTTP request with
> content type image/jpeg).

I am not sure what you mean by the description above.

> The CGI app seems (even though the phone sends more data) ALWAYS to
> receive 8440 bytes.  The code to receive this data is:
> 
> use CGI;
> use CGI::Carp qw(fatalsToBrowser);
> 
> my ($data,@args);
> 
> $data = join '',<>;
> 
> # right here length($data) is always 8440.

Is it always 8440 bytes with the same image or is it 8440 with different 
images?

You are using CGI.pm. Why are you not using CGI.pm and the documentation 
of that module. I am assuming you are doing the equivalent of a file 
upload form. There is a specific way in which the POST request to do 
that needs to be formed. For more information on how to craft that 
request and how to handle the incoming data, see the documentation for 
CGI.pm.

> I looked for an Apache setting that might be causing this, but I
> didn't see anything.  Can anyone point me in the right direction ?

There is also $CGI::POST_MAX but I am not sure if it should have any 
effect with the code above.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



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

Date: 10 Aug 2006 07:15:28 -0700
From: timnels@gmail.com
Subject: Re: POST data truncated in a cgi application
Message-Id: <1155219328.610996.24320@75g2000cwc.googlegroups.com>


A. Sinan Unur wrote:
> timnels@gmail.com wrote in news:1155213393.018278.241120
> @i42g2000cwa.googlegroups.com:
>
> > I have what I thought was a simple CGI application which takes a POST
> > of a jpeg image from a Nextel phone (creates an HTTP request with
> > content type image/jpeg).
>
> I am not sure what you mean by the description above.
>
> > The CGI app seems (even though the phone sends more data) ALWAYS to
> > receive 8440 bytes.  The code to receive this data is:
> >
> > use CGI;
> > use CGI::Carp qw(fatalsToBrowser);
> >
> > my ($data,@args);
> >
> > $data = join '',<>;
> >
> > # right here length($data) is always 8440.
>
> Is it always 8440 bytes with the same image or is it 8440 with different
> images?
>
> You are using CGI.pm. Why are you not using CGI.pm and the documentation
> of that module. I am assuming you are doing the equivalent of a file
> upload form. There is a specific way in which the POST request to do
> that needs to be formed. For more information on how to craft that
> request and how to handle the incoming data, see the documentation for
> CGI.pm.
>
> > I looked for an Apache setting that might be causing this, but I
> > didn't see anything.  Can anyone point me in the right direction ?
>
> There is also $CGI::POST_MAX but I am not sure if it should have any
> effect with the code above.
>
> Sinan
>
> --
> A. Sinan Unur <1usa@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
>
> comp.lang.perl.misc guidelines on the WWW:
> http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

Ahh... sorry ... this problem (although it is ahrd to believe) seems to
the the app on the Java phone (or the J2ME implementation).  An i860
phone works perfect for files over 8440, but has the error when I
install it on the i850.



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

Date: 10 Aug 2006 07:20:45 -0700
From: "Bart Van der Donck" <bart@nijlen.com>
Subject: Re: POST data truncated in a cgi application
Message-Id: <1155219645.363128.99710@m73g2000cwd.googlegroups.com>

timnels@gmail.com wrote:

> I have what I thought was a simple CGI application which takes a POST
> of a jpeg image from a Nextel phone (creates an HTTP request with
> content type image/jpeg).

  #!/usr/bin/perl
  use strict;
  use warnings;
  use CGI qw/:standard/;
  print "Content-Type: image/jpeg\n\n";
  my $fh = upload('myfile');
  print while (<$fh>);

> The CGI app seems (even though the phone sends more data) ALWAYS to
> receive 8440 bytes.  The code to receive this data is:
>
> use CGI;
> use CGI::Carp qw(fatalsToBrowser);
> my ($data,@args);
> $data = join '',<>;
> # right here length($data) is always 8440.

You can't use  <>  and  length()  that way to retrieve file size. This
is a more 'official' way:

  #!/usr/bin/perl
  use strict;
  use warnings;
  use CGI qw/:standard/;
  print "Content-Type: text/html\n\n";
  my $fh = upload('myfile');
  print 'Size = ' . (stat ($fh))[7] . ' bytes';

I'm using the following form:

 <html>
  <body>
   <form method="post"
         action="script.cgi"
         enctype="multipart/form-data">
   <input type="file" name="myfile">
   <input type="submi"t>
   </form>
  </body>
 </html>

> I looked for an Apache setting that might be causing this, but I didn't
> see anything.

I don't see how Apache could be involved in this.

> Can anyone point me in the right direction ?

 http://search.cpan.org/dist/CGI.pm/CGI.pm

Hope this helps,

-- 
 Bart



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

Date: Thu, 10 Aug 2006 11:36:50 GMT
From: Dirk Heinrichs <ext-dirk.heinrichs@nokia.com>
Subject: regex and utf8 characters (german umlauts)
Message-Id: <mTECg.34879$Nb2.643649@news1.nokia.com>

Hi,

the following little perl snippet

perl -e '($string = "AAA ÄÄÄ BBB CCC DDD") =~ s/(\p{IsUpper}+)/\L\u\1\E/g;
print $string . "\n"'

gives this result:

Aaa ÄÄÄ Bbb Ccc Ddd

How do I turn those umlauts into "Äää" also? I tried adding "use utf8;", but
that didn't help.

Thanks...

        Dirk
-- 
Dirk Heinrichs          | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: dirk.heinrichs@capgemini.com
Hambornerstraße 55      | Web:  http://www.capgemini.com
D-40472 Düsseldorf      | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net


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

Date: Thu, 10 Aug 2006 14:24:07 +0200
From: "Dave" <daveandniki@ntlworld.com>
Subject: Re: regex and utf8 characters (german umlauts)
Message-Id: <44db2570$0$868$ba4acef3@news.orange.fr>


"Dirk Heinrichs" <ext-dirk.heinrichs@nokia.com> wrote in message 
news:mTECg.34879$Nb2.643649@news1.nokia.com...
> Hi,
>
> the following little perl snippet
>
> perl -e '($string = "AAA ÄÄÄ BBB CCC DDD") =~ s/(\p{IsUpper}+)/\L\u\1\E/g;
> print $string . "\n"'
>
> gives this result:
>
> Aaa ÄÄÄ Bbb Ccc Ddd
>
> How do I turn those umlauts into "Äää" also? I tried adding "use utf8;", 
> but
> that didn't help.
>
> Thanks...
>
>        Dirk
> -- 
> Dirk Heinrichs          | Tel:  +49 (0)162 234 3408
> Configuration Manager   | Fax:  +49 (0)211 47068 111
> Capgemini Deutschland   | Mail: dirk.heinrichs@capgemini.com
> Hambornerstraße 55      | Web:  http://www.capgemini.com
> D-40472 Düsseldorf      | ICQ#: 110037733
> GPG Public Key C2E467BB | Keyserver: www.keyserver.net

Are you running this in a unicode shell with unicode input? Also what 
version of perl?




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

Date: Thu, 10 Aug 2006 13:34:34 GMT
From: Dirk Heinrichs <ext-dirk.heinrichs@nokia.com>
Subject: Re: regex and utf8 characters (german umlauts)
Message-Id: <KBGCg.35288$_k2.624944@news2.nokia.com>

Dave wrote:

> Are you running this in a unicode shell with unicode input? Also what
> version of perl?

Yes, in KDE's Konsole configured for UTF-8 and LANG set to de_DE.utf8. Perl
version is 5.8.8, OS is (Gentoo) Linux.

Bye...

        Dirk
-- 
Dirk Heinrichs          | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: dirk.heinrichs@capgemini.com
Hambornerstraße 55      | Web:  http://www.capgemini.com
D-40472 Düsseldorf      | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net


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

Date: 10 Aug 2006 07:17:13 -0700
From: praveen.kantharajapura@gmail.com
Subject: Sorting integers in perl
Message-Id: <1155219433.907016.35300@75g2000cwc.googlegroups.com>

Hi all,

I have a file which contains characters as well as integers.
Now i should sort all the integers ??
How to go about doing it.

Regards,
Praveen



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

Date: Thu, 10 Aug 2006 14:18:40 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Sorting integers in perl
Message-Id: <4fHCg.56018$gU4.28743@trnddc07>

praveen.kantharajapura@gmail.com wrote:
> I have a file which contains characters as well as integers.
> Now i should sort all the integers ??
> How to go about doing it.

Most people would probably use the sort() function.

jue 




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

Date: 10 Aug 2006 07:56:22 -0700
From: gkarpo@gmail.com
Subject: Re: Sorting integers in perl
Message-Id: <1155221782.308800.85470@p79g2000cwp.googlegroups.com>

sort() should do, but it defaults to sorting in string mode.
You would need to switch to numeric mode: sort { $a <=> $b } @list

GK


praveen.kantharajapura@gmail.com wrote:
> Hi all,
>
> I have a file which contains characters as well as integers.
> Now i should sort all the integers ??
> How to go about doing it.
> 
> Regards,
> Praveen



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

Date: 10 Aug 2006 10:31:51 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: ||== ,&&== ,|= ,&=
Message-Id: <4k0g8nF9vtbsU1@news.dfncis.de>

Michele Dondi  <bik.mido@tiscalinet.it> wrote in comp.lang.perl.misc:
> On 9 Aug 2006 23:51:23 -0700, "sujay.tukai@gmail.com"
> <sujay.tukai@gmail.com> wrote:
> 
> >What is the work done by these assignment operators...
> >
> >            ||==,       &&==,    |=,    &=
> 
> This is easy:
> 
>   $x ||= $y;  # is equivalent to
>   $x = $x || $y;  # and the same goes for the other ones

 ...except that the first two don't exist.

Anno


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

Date: 10 Aug 2006 12:45:44 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: ||== ,&&== ,|= ,&=
Message-Id: <bc3md2t6gu0vbriscodu5gtrjelmv2acko@4ax.com>

On 10 Aug 2006 10:31:51 GMT, anno4000@radom.zrz.tu-berlin.de wrote:

>> >            ||==,       &&==,    |=,    &=
>> 
>> This is easy:
>> 
>>   $x ||= $y;  # is equivalent to
>>   $x = $x || $y;  # and the same goes for the other ones
>
>...except that the first two don't exist.

Oops! I didn't even notice...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 10 Aug 2006 04:10:37 -0700
From: "sujay.tukai@gmail.com" <sujay.tukai@gmail.com>
Subject: Re: ||== ,&&== ,|= ,&=
Message-Id: <1155208237.160830.227470@m79g2000cwm.googlegroups.com>


Michele Dondi wrote:
> On 10 Aug 2006 10:31:51 GMT, anno4000@radom.zrz.tu-berlin.de wrote:
>
> >> >            ||==,       &&==,    |=,    &=
> >>
> >> This is easy:
> >>
> >>   $x ||= $y;  # is equivalent to
> >>   $x = $x || $y;  # and the same goes for the other ones
> >
> >...except that the first two don't exist.
>
> Oops! I didn't even notice...


sorry my mistake i typed the equal sign twice



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

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


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