[23546] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5754 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 5 14:05:44 2003

Date: Wed, 5 Nov 2003 11:05:09 -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           Wed, 5 Nov 2003     Volume: 10 Number: 5754

Today's topics:
    Re: Changing from capital letters to small letters usin <flavell@ph.gla.ac.uk>
    Re: Changing from capital letters to small letters usin <tassilo.parseval@rwth-aachen.de>
    Re: file copy.. (William Herrera)
    Re: MIME::Lite on ActivePerl <Russbucket@centurytel.net>
        Need Some Error Help (Gary Hartl)
    Re: Need Some Error Help <abigail@abigail.nl>
        Net::FTP::Recursive doesn't work on Nortel Contivity (Jim)
    Re: Net::SSH::Perl <jwillmore@remove.adelphia.net>
    Re: Net::SSH::Perl <jwillmore@remove.adelphia.net>
    Re: Net::SSH::Perl <jwillmore@remove.adelphia.net>
    Re: Newbie gets Internal Server Error, among others (Jessica Smith)
    Re: Newbie question - create a file <bluecat22@go.com>
    Re: Perl can't locate a .pm in @INC (Gary Hartl)
        Perl localtime strange behavior (Teknopath)
    Re: Perl localtime strange behavior <tony_curtis32@_SPAMTRAP_yahoo.com>
    Re: Perl localtime strange behavior <noreply@gunnar.cc>
    Re: Perl localtime strange behavior <syscjm@gwu.edu>
    Re: printing characters <flavell@ph.gla.ac.uk>
    Re: printing characters <flavell@ph.gla.ac.uk>
    Re: printing characters <fJogham@yahoo.com>
        problem with if-else assignment in text database (Vumani Dlamini)
    Re: Sorting in Safe compartments under Perl 5.8 <fiedorow@hotmail.com>
        Split problem. <spikeywan@bigfoot.com.delete.this.bit>
    Re: Split problem. <ak+usenet@freeshell.org>
    Re: Split problem. <trammell+usenet@hypersloth.invalid>
    Re: Split problem. <spikeywan@bigfoot.com.delete.this.bit>
    Re: Split problem. <pinyaj@rpi.edu>
    Re: Split problem. <spikeywan@bigfoot.com.delete.this.bit>
    Re: Split problem. <trammell+usenet@hypersloth.invalid>
    Re: Splitting an array into "even" parts <tore@aursand.no>
    Re: Verbose warnings (Greg Bacon)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 5 Nov 2003 15:11:02 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Changing from capital letters to small letters using perl
Message-Id: <Pine.LNX.4.53.0311051508410.18556@ppepc56.ph.gla.ac.uk>

On Wed, 5 Nov 2003, Tassilo v. Parseval wrote:

> >> $text =~ y/A-Z/a-z/;
> >
> > Which of course works only for a small subset of letters even in
> > ISO-Latin-1, not to mention other character sets.
> > Better to use the proper function lc().

Hey, didn't the group just have this discussion, a few days back?

> Plus 'use locale', otherwise lc() will just handle those characters in
> the ASCII character set.

That's clear enough if you're working in one 8-bit locale.

See the earlier discussion re strange interactions between "use
locale" and Unicode support, if you go beyond that.


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

Date: 5 Nov 2003 18:07:00 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Changing from capital letters to small letters using perl
Message-Id: <bobe84$3p6$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Alan J. Flavell:

> On Wed, 5 Nov 2003, Tassilo v. Parseval wrote:
> 
>> >> $text =~ y/A-Z/a-z/;
>> >
>> > Which of course works only for a small subset of letters even in
>> > ISO-Latin-1, not to mention other character sets.
>> > Better to use the proper function lc().
> 
> Hey, didn't the group just have this discussion, a few days back?

Hom come that I somehow assumed that you, Alan, would pop in and join
this thread? :-)

>> Plus 'use locale', otherwise lc() will just handle those characters in
>> the ASCII character set.
> 
> That's clear enough if you're working in one 8-bit locale.
> 
> See the earlier discussion re strange interactions between "use
> locale" and Unicode support, if you go beyond that.

No, I absolutely wont. Localization stops for me when it involves more
than eight bits. I am clueless to an almost criminal extent when it
comes to Unicode. :-)

Which is why I tend to read all your articles on this topic here in this
group more carefully and in-depth since they always tell me things I
wasn't in the least aware of before.

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: Wed, 05 Nov 2003 14:12:12 GMT
From: wherrera@lynxview.com (William Herrera)
Subject: Re: file copy..
Message-Id: <3fa904d7.123888923@news2.news.adelphia.net>

On Wed, 5 Nov 2003 13:50:55 -0000, "Nimmy" <nojunk@please.com> wrote:

>Any one have a script to run on my Windows Xp machine for the following file
>operations:
>
>a) I have a file called xyz.ppt
>b) If the time and date stamp changed, I mean basically if the file has been
>modified, I want the SCRIPT to copy/overwrite that file in few other
>different directory folders.
>

Though you can still write most of the scripting logic in Perl, I would use
Windows xcopy /D for this, since it adheres closely to what the Win32 system
thinks is a modified file and does not make Unix file system assumptions. Look
up the docs for xcopy.


---
Use the domain skylightview (dot) com for the reply address instead.


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

Date: Wed, 5 Nov 2003 08:23:36 -0800
From: "Russbucket" <Russbucket@centurytel.net>
Subject: Re: MIME::Lite on ActivePerl
Message-Id: <1cKdndyCtcTguTSiRVn-hA@centurytel.net>

Mime::Lite works fine with the Windows and Unix environments. I use WinME
with PWs to debug my web pages before send to a Unix server. There are some
changes need for the Unix side. But mime lite does work.
"Anurat Chapanond" <anuratic@mailcity.com> wrote in message
news:Gu4qb.53491$ZC4.4074@twister.nyroc.rr.com...
> Hi,
>     I want to do automatic email sending on my windows machine. So I get
> ActivePerl installed on my machine. I think I need MIME::Lite in order to
do
> automatic email sending. However I'm not sure if the package is for unix
> only or it can be installed on windows as well. I'm really new to Perl.
Any
> advice would be appreciated.
>
> Thank you,
> Anurat
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.536 / Virus Database: 331 - Release Date: 11/3/2003




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

Date: 5 Nov 2003 06:21:55 -0800
From: the-smtpguy@cogeco.ca (Gary Hartl)
Subject: Need Some Error Help
Message-Id: <99e21f6f.0311050621.4d3380b2@posting.google.com>

Greets to all Again;

ok, i'm moving along in my quest to get this script working.

I'm getting a strange error from my script and I only half know what
it means.

The script is using
POSIX and 
DB_File

Both are installed, POSIX is included in the perl distro (i'm using
5.8.0), and I installed DB_File which seemed to be ok at least to me
anyway.

My error is as follows: 
[Wed Nov  5 08:41:59 2003] mach10.pl: Can't call method "fields"
without a package or object reference at /usr/lib/perl5/5.8.0/SkyIm
port.pm line 1548, <INFILE> line 7.

Line 1548 is:
foreach $field ($cloneUser->fields()){
                                $newUser->set_attribute($field,
$cloneUser->get_attribute($field));
                        }

i have no clue what the <INFILE> line 7 is thou.... is this reference
to one of the Modules that i'm using ( POSIX, DB_File ),

Any suggestions would be appreciated.

Cheers and Thanks to all,

Gary


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

Date: 05 Nov 2003 16:00:05 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Need Some Error Help
Message-Id: <slrnbqi7k5.2a0.abigail@alexandra.abigail.nl>

Gary Hartl (the-smtpguy@cogeco.ca) wrote on MMMDCCXVIII September
MCMXCIII in <URL:news:99e21f6f.0311050621.4d3380b2@posting.google.com>:
][  Greets to all Again;
][  
][  ok, i'm moving along in my quest to get this script working.
][  
][  I'm getting a strange error from my script and I only half know what
][  it means.
][  
][  The script is using
][  POSIX and 
][  DB_File
][  
][  Both are installed, POSIX is included in the perl distro (i'm using
][  5.8.0), and I installed DB_File which seemed to be ok at least to me
][  anyway.
][  
][  My error is as follows: 
][  [Wed Nov  5 08:41:59 2003] mach10.pl: Can't call method "fields"
][  without a package or object reference at /usr/lib/perl5/5.8.0/SkyIm
][  port.pm line 1548, <INFILE> line 7.

What's SkyImport.pm doing in that directory? Don't you have a 
site_perl directory for locally installed stuff?

][  Line 1548 is:
][  foreach $field ($cloneUser->fields()){
][                                  $newUser->set_attribute($field,
][  $cloneUser->get_attribute($field));

It means that $cloneUser isn't an object or a class. It's likely
to be undefined.

][  i have no clue what the <INFILE> line 7 is thou.... is this reference
][  to one of the Modules that i'm using ( POSIX, DB_File ),

It means that the last line you've read was line 7 of the file handle
called INLINE.



Abigail
-- 
perl -wlpe '}{$_=$.' file  # Count the number of lines.


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

Date: 5 Nov 2003 09:41:08 -0800
From: jimnl69@hotmail.com (Jim)
Subject: Net::FTP::Recursive doesn't work on Nortel Contivity
Message-Id: <3966ee66.0311050941.7de3891e@posting.google.com>

I'm trying to use the Net::FTP::Recursive module to do backups of a
Nortel Contivity box (yes, I'm aware it has a built in backup function
but it doesn't work very good).  It goes into my initial directory
(/SYSTEM) just fine and downloads all the files.  It then successfully
goes into the first directory and gets all of those files.  However,
it fails coming out of the first directory.  I would assume it's
because Nortel doesn't support the CDUP command on their ftp
interface.  However, they also don't support the CWD command so I
don't know how I'm getting into the first subdirectory anyway.

Below is the output of what's happening.  Any help would be greatly
appreciated!

Net::FTP::Recursive=GLOB(0x1832704)>>> PORT 129,37,2,201,18,199
Net::FTP::Recursive=GLOB(0x1832704)<<< 200 Port set okay
Net::FTP::Recursive=GLOB(0x1832704)>>> RETR 20030725.DAT
Net::FTP::Recursive=GLOB(0x1832704)<<< 150 Opening BINARY mode data
connection
Net::FTP::Recursive=GLOB(0x1832704)<<< 226 Transfer complete
Returned from rget in /SYSTEM.
Net::FTP::Recursive=GLOB(0x1832704)>>> CDUP
Net::FTP::Recursive=GLOB(0x1832704)<<< 500 Command "(null)" not
understood
Net::FTP::Recursive=GLOB(0x1832704)>>> CWD BIN
Net::FTP::Recursive=GLOB(0x1832704)<<< 501 Directory non existent or
syntax error
Was unable to cd to BIN, skipping!
Net::FTP::Recursive=GLOB(0x1832704)>>> CWD CERT
Net::FTP::Recursive=GLOB(0x1832704)<<< 501 Directory non existent or
syntax error
Was unable to cd to CERT, skipping!


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

Date: Wed, 05 Nov 2003 15:57:39 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Net::SSH::Perl
Message-Id: <20031105105247.1dfb37be.jwillmore@remove.adelphia.net>

On 4 Nov 2003 20:16:14 GMT
Rick Thiessen <member47009@dbforums.com> wrote:

<cleaned post>
> 
> I am attempting to modify a control program to use ssl
> communicatoins.
> 
> It is to a cisco switch and requires a login to a secondary admin
> level.  This area is accessed through a password.
> 
> I have been accessing this system but using a port 23 connection
> socket and need to secure the port 23.
> 
> I have tried using the Net::SSH::Perl module to push the commands
> through and it works fine to the first layer of commands but is
> infact connecting with every request and will not respond if 
> there is no newline from the remote on a password prompt.
> 
> How do I maintain a connection using ssh and how to I automate
> the password check and response.
> 
> Is there a way of opening a socket connection to simulate
> an interactive session with the remote ssh connection.

There are a few options.

Ther are a few Cisco modules that _may_ help you out:
(http://search.cpan.org/search?query=cisco&mode=module)

You could also try using the Expect module
(http://search.cpan.org/~rgiersig/Expect-1.15/Expect.pod)

I suggest these because I'm not 100% sure that Net::SSH will do it for
you.  However, I could be wrong :-(

Some could would be helpful :-)

HTH

-- 
Jim

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

a fortune quote ...
Pohl's law:  Nothing is so good that somebody, somewhere, will
<not hate it. 


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

Date: Wed, 05 Nov 2003 15:58:19 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Net::SSH::Perl
Message-Id: <20031105105322.7e46a74b.jwillmore@remove.adelphia.net>

On 4 Nov 2003 20:16:14 GMT
Rick Thiessen <member47009@dbforums.com> wrote:

<cleaned post>
> 
> I am attempting to modify a control program to use ssl
> communicatoins.
> 
> It is to a cisco switch and requires a login to a secondary admin
> level.  This area is accessed through a password.
> 
> I have been accessing this system but using a port 23 connection
> socket and need to secure the port 23.
> 
> I have tried using the Net::SSH::Perl module to push the commands
> through and it works fine to the first layer of commands but is
> infact connecting with every request and will not respond if 
> there is no newline from the remote on a password prompt.
> 
> How do I maintain a connection using ssh and how to I automate
> the password check and response.
> 
> Is there a way of opening a socket connection to simulate
> an interactive session with the remote ssh connection.

There are a few options.

Ther are a few Cisco modules that _may_ help you out:
(http://search.cpan.org/search?query=cisco&mode=module)

You could also try using the Expect module
(http://search.cpan.org/~rgiersig/Expect-1.15/Expect.pod)

I suggest these because I'm not 100% sure that Net::SSH will do it for
you.  However, I could be wrong :-(

Some could would be helpful :-)

HTH

-- 
Jim

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

a fortune quote ...
Pohl's law:  Nothing is so good that somebody, somewhere, will
<not hate it. 


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

Date: Wed, 05 Nov 2003 16:05:44 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Net::SSH::Perl
Message-Id: <20031105110052.199ca85d.jwillmore@remove.adelphia.net>

On Wed, 05 Nov 2003 15:58:19 GMT
James Willmore <jwillmore@remove.adelphia.net> wrote:
<snip>

This one got away.  Me and the newsreader got into a dis-agreement :-(

-- 
Jim

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

a fortune quote ...
There are three ways to get something done:  (1) Do it yourself. 
(2) Hire someone to do it for you.  (3) Forbid your kids to do
it. 


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

Date: 5 Nov 2003 09:00:24 -0800
From: jessis@cobweb.net (Jessica Smith)
Subject: Re: Newbie gets Internal Server Error, among others
Message-Id: <89ed09a8.0311050900.3d1a9510@posting.google.com>

First of all, thank you so much for extending help. 

The #! line is right. There's no space after the exclamation point,
and I did a "where perl" to check the directory.

What's up with this line-ending stuff? I don't know what that does,
where it is, what it should be, or how I could change it.  I found
this OS X "explanation" online (http://www.osxfaq.com/man/1/col.ws)
but it didn't help much.

Thanks again.


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

Date: Wed, 5 Nov 2003 09:32:15 -0500
From: "Blue Cat" <bluecat22@go.com>
Subject: Re: Newbie question - create a file
Message-Id: <bob5hi017j4@enews1.newsguy.com>


"Ben Morrow" <usenet@morrow.me.uk> wrote in message
news:bo8eo3$jhd$1@wisteria.csv.warwick.ac.uk...
> "Blue Cat" <bluecat22@go.com> wrote:
> > After toiling over "open" in the Perl docs and the Camel Book with no
> > success, I am asking for help:
> >
> > How do I create a file named "dogs.txt" and write "My dog is a golden
> > retriever." into it?
>
> open my $DOGS, "> dogs.txt" or die "can't open dogs.txt: $!";
> print $DOGS "My dog is a golden retriever.";
>
> What did you try, and in what way did it fail?
>
I had the syntax all messed up. I was using a number for a filehandle (like
in BASIC). The script would execute without error messages, but no file
would be created.

The advise from you and the others who answered helped me a great deal.
Thanks




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

Date: 5 Nov 2003 06:25:44 -0800
From: the-smtpguy@cogeco.ca (Gary Hartl)
Subject: Re: Perl can't locate a .pm in @INC
Message-Id: <99e21f6f.0311050625.96502b7@posting.google.com>

Well i got lazy, and fixed the problem the good old fashion way.

I just copied the .pm's to my /usr/lib/perl5/5.8.0 directory and it
works, outside of my previous post with <INFILE> errors ( which i have
no clue about), but that is left for another post :)

Cheers and Thanks to all for the replies, they were most helpful :)

Gary


jwillmore@myrealbox.com (James Willmore) wrote in message news:<d61170e5.0311041841.3171c3bf@posting.google.com>...
> the-smtpguy@cogeco.ca (Gary Hartl) wrote in message news:<99e21f6f.0311041333.1b436e32@posting.google.com>...
> > Hello all again,
> > 
> > I'm not much of a perl programer but I am trying to get this script to
> > run and it is giving me a headache :)
> > 
> > I'm getting premature end of script header errors and I'm pretty sure
> > why.
> > 
> > Here is everything I think is important for this situation, if i'm
> > missing something please let me know and I'll supply anything else.
> > 
> > I have some .pm files ina directory called /home/mach10/dist/lib 
> > 
> > the first line of the script calls 
> > use lib ($ENV{'MACH10_LIB'} || '/home/mach10/dist/lib');
> <snip>
> 
> You could just set the $ENV{'MACH10_LIB'} variable _first_, then set
> the 'lib' path accordingly.
> 
> --untested--
> $ENV{'MACH10_LIB'} = '/home/mach10/dist/lib' unless defined
> $ENV{'MACH10_LIB'};
> use lib "$ENV{'MACH10_LIB'}";
> --untested--
> 
> HTH
> 
> Jim
> (jwillmore _at_ adelphia _dot_ net)


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

Date: 5 Nov 2003 07:37:36 -0800
From: teknopath@yahoo.com (Teknopath)
Subject: Perl localtime strange behavior
Message-Id: <46d34893.0311050737.c72c629@posting.google.com>

Any help would be appreciated...

I do the following in my code:

$inputQueueCounts{$queueN}{'Time'} = localtime;
if ($bufferLength >= $inputQueueCounts{$queueN}{'Max'})
{
    $inputQueueCounts{$queueN}{'Max'} = $bufferLength;
    $inputQueueCounts{$queueN}{'MaxTime'} =
$inputQueueCounts{$queueN}{'Time'};
}


I would expect $inputQueueCounts{$queueN}{'Time'} and
$inputQueueCounts{$queueN}{'MaxTime'} to have the same value, but in
actuality, $inputQueueCounts{$queueN}{'MaxTime'} is showing 10 seconds
earlier.  How could this be happening?


:meb:


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

Date: Wed, 05 Nov 2003 09:44:57 -0600
From: Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com>
Subject: Re: Perl localtime strange behavior
Message-Id: <87oevqvmyu.fsf@limey.hpcc.uh.edu>

>> On 5 Nov 2003 07:37:36 -0800,
>> teknopath@yahoo.com (Teknopath) said:

> Any help would be appreciated...  I do the following in my
> code:

> $inputQueueCounts{$queueN}{'Time'} = localtime; if
> ($bufferLength >= $inputQueueCounts{$queueN}{'Max'}) {
> $inputQueueCounts{$queueN}{'Max'} = $bufferLength;
> $inputQueueCounts{$queueN}{'MaxTime'} =
> $inputQueueCounts{$queueN}{'Time'};
> }

> I would expect $inputQueueCounts{$queueN}{'Time'} and
> $inputQueueCounts{$queueN}{'MaxTime'} to have the same
> value, but in actuality,
> $inputQueueCounts{$queueN}{'MaxTime'} is showing 10 seconds
> earlier.  How could this be happening?

With the code you show, suitable setup values for the
variables in question to trigger the "if", and caeteris
paribus, both of them (of course) have the same value.

This presumably isn't the whole of your program.  I suspect
you have another assignment occurring somewhere, or the "if"
condition is false.

hth
t


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

Date: Wed, 05 Nov 2003 16:48:06 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Perl localtime strange behavior
Message-Id: <bob66q$1bdbck$1@ID-184292.news.uni-berlin.de>

Teknopath wrote:
> 
> $inputQueueCounts{$queueN}{'Time'} = localtime;
> if ($bufferLength >= $inputQueueCounts{$queueN}{'Max'})
> {
>     $inputQueueCounts{$queueN}{'Max'} = $bufferLength;
>     $inputQueueCounts{$queueN}{'MaxTime'} =
> $inputQueueCounts{$queueN}{'Time'};
> }
> 
> I would expect $inputQueueCounts{$queueN}{'Time'} and 
> $inputQueueCounts{$queueN}{'MaxTime'} to have the same value, but
> in actuality, $inputQueueCounts{$queueN}{'MaxTime'} is showing 10
> seconds earlier.  How could this be happening?

How on earth do you think that anybody here would be able to tell
out from the above info?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Wed, 05 Nov 2003 12:51:16 -0500
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: Perl localtime strange behavior
Message-Id: <3FA93894.9060807@gwu.edu>

Teknopath wrote:
> Any help would be appreciated...
> 
> I do the following in my code:
> 
> $inputQueueCounts{$queueN}{'Time'} = localtime;
> if ($bufferLength >= $inputQueueCounts{$queueN}{'Max'})
> {
>     $inputQueueCounts{$queueN}{'Max'} = $bufferLength;
>     $inputQueueCounts{$queueN}{'MaxTime'} =
> $inputQueueCounts{$queueN}{'Time'};
> }
> 
> 
> I would expect $inputQueueCounts{$queueN}{'Time'} and
> $inputQueueCounts{$queueN}{'MaxTime'} to have the same value, but in
> actuality, $inputQueueCounts{$queueN}{'MaxTime'} is showing 10 seconds
> earlier.  How could this be happening?
> 
It is happening because $bufferLength is less than
$inputQueueCounts{$queueN}{'Max'}.

         Chris Mattern



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

Date: Wed, 5 Nov 2003 15:14:50 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: printing characters
Message-Id: <Pine.LNX.4.53.0311051512170.18556@ppepc56.ph.gla.ac.uk>

On Wed, 5 Nov 2003, Fred wrote:

> just like 0x03B1 is a code point for the GREEK SMALL LETTER ALPHA. I
> thought there  would be a list where images would have some code points
> then I choose the right code point for what ever image I would like to
> output.

http://www.unicode.org - nothing specific to Perl.

See e.g http://www.unicode.org/charts/

> hummmmm is must be more complicated than that from the responses
> I got.

There _are_ some Perl issues, but you don't seem to have reached them
yet.

good luck


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

Date: Wed, 5 Nov 2003 15:16:17 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: printing characters
Message-Id: <Pine.LNX.4.53.0311051515190.18556@ppepc56.ph.gla.ac.uk>

On Wed, 5 Nov 2003, Abigail wrote:

> You can't print squares that have been sold. Once sold, they are
> gone. You'll have to buy new squares first.

I thought this was about Unicode, not Monopoly.

"Go directly to jail, do not collect $200".


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

Date: Thu, 06 Nov 2003 06:05:03 +1100
From: Fred <fJogham@yahoo.com>
Subject: Re: printing characters
Message-Id: <3FA949DF.4010106@yahoo.com>

Alan J. Flavell wrote:
> On Wed, 5 Nov 2003, Abigail wrote:
> 
> 
>>You can't print squares that have been sold. Once sold, they are
>>gone. You'll have to buy new squares first.
> 
> 
> I thought this was about Unicode, not Monopoly.
> 
> "Go directly to jail, do not collect $200".

:)



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

Date: 5 Nov 2003 11:01:07 -0800
From: dvumani@hotmail.com (Vumani Dlamini)
Subject: problem with if-else assignment in text database
Message-Id: <4b35f3c9.0311051101.772ccbfb@posting.google.com>

I am trying to extract the value of the number of males employed by a
company and used the expression below: The file contains data on
several companies. I would then like to store the variable with the
same length. Thus I would like to pad values below "10" by "0". The
problem is that some field have "00" for the number of males employed,
thus I try to test whether all two positions are filled before the
assignment using the expression below, but it seemingly doesn't work,


elsif (/EMPmale=(\S+)/) {
  if ($1 == /\S{2}/) {$Emale = $1 ;}
  else {$Emale = "0$1" ;} 
}

I have also tried,

elsif (/EMPmale=(\S+)/) {
  $Emale = $1 if $1 == /\S{2}/ ;
  $Emale = "0$1" if $1 == /\S/ ;
}

But it also does not seem to give what I expect. Hope you girls (and
possibly guys) help me as always.


Vumani


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

Date: Wed, 05 Nov 2003 10:50:58 -0500
From: Zbigniew Fiedorowicz <fiedorow@hotmail.com>
Subject: Re: Sorting in Safe compartments under Perl 5.8
Message-Id: <bob6ak$e8r$1@charm.magnus.acs.ohio-state.edu>

Here's another data point (according to private email): the code runs fine
under Perl 5.8.0/SunOS 5.8 with Safe version 2.07

Zbigniew Fiedorowicz wrote:
> I've run into problem in using sort under Perl 5.8.0 running under the 
> Linux Redhat 9.0 distribution.  The code works flawlessly under Perl 
> 5.6.0 under Linux Redhat 7.2. Under 5.8.0/RH 9.0 sorting fails with 
> error messages of the form:
> 
> Use of uninitialized value in numeric comparison (<=>) at (eval 2)
> 
> I'd be particularly interested in hearing whether this code works under 
> Perl 5.8.0 under other operating systems.
> 
> Here's the code:
> ----------- cut here ----------------------
> #!/usr/bin/perl -w
> 
> use strict;
> use Safe;
> 
> sub PGsort {
>     local($a,$b);
>         my $compare = shift;
> 
>         sort {&$compare($a, $b) } @_;
> }
> 
> 
> my   $cmp = new Safe;
> print "Safe version $Safe::VERSION\n";
> 
> $cmp->share('&PGsort');
> my $string = <<'EOF';
> 
> my @list = (4,6,2, 5 ,10, 8, 9 );
> 
> my $str = join( " ", PGsort  sub {$_[0]  <=> $_[1] } , @list );
> 
> print $str;
> 
> EOF
> 
> $cmp->reval($string);
> ----------- cut here ----------------------
> 
> Thanks in advance,
> Zbigniew Fiedorowicz
> 



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

Date: Wed, 5 Nov 2003 15:18:27 -0000
From: "Richard S Beckett" <spikeywan@bigfoot.com.delete.this.bit>
Subject: Split problem.
Message-Id: <bob4es$t49$1@newshost.mot.com>

Guys,

I have a line of text like this "         5    6       0        7   176
0". i.e. 9 spaces before the 5.

When I try to place the numbers into an array with split (my @temp = split
(/\s*/, $input);), I get a blank element at the start. What am I doing
wrong?

Thanks.
=-=-=-=-=-=-=-=-=-=-
use strict;
use warnings;
my $line = "         5    6       0        7   176      0";
my @array = split (/\s*/, $line);
print "Starting...\n";
foreach (0..$#array) {
 print "element $_ = $array[$_]\n";
}
print "Finished.\n";
=-=-=-=-=-=-=-=-=-=-
OUTPUT:
Starting...
element 0 =
element 1 = 5
element 2 = 6
element 3 = 0
element 4 = 7
element 5 = 1
element 6 = 7
element 7 = 6
element 8 = 0
Finished.
-- 
R.
GPLRank +79.699




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

Date: Wed, 5 Nov 2003 15:35:30 +0000 (UTC)
From: Andreas Kahari <ak+usenet@freeshell.org>
Subject: Re: Split problem.
Message-Id: <slrnbqi65t.6df.ak+usenet@mx.freeshell.org>

In article <bob4es$t49$1@newshost.mot.com>, Richard S Beckett wrote:
> Guys,
> 
> I have a line of text like this "         5    6       0        7   176
> 0". i.e. 9 spaces before the 5.
> 
> When I try to place the numbers into an array with split (my @temp = split
> (/\s*/, $input);), I get a blank element at the start. What am I doing
> wrong?

If a list is separated by colons like this:

    1:2:3:4:5

then we can agree on that there are five items in the list.
What about this list then:

    :1:2:3:4:5

Perl believes that the first element is an empty element since
we've separatedt it from the second element, which is '1'.

The "solution" would be to remove all flanking separators:

    $list =~ s/^:*//;
    $list =~ s/:*$//;

and then split it

    @arr = split /:/, $list;


This applies to your choise of seperator as well.


-- 
Andreas Kähäri


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

Date: Wed, 5 Nov 2003 15:47:24 +0000 (UTC)
From: "John J. Trammell" <trammell+usenet@hypersloth.invalid>
Subject: Re: Split problem.
Message-Id: <slrnbqi6sc.h0e.trammell+usenet@hypersloth.el-swifto.com.invalid>

On Wed, 5 Nov 2003 15:18:27 -0000, Richard S Beckett wrote:
> Guys,
> 
> I have a line of text like this "         5    6       0        7   176
> 0". i.e. 9 spaces before the 5.
> 
> When I try to place the numbers into an array with split (my @temp = split
> (/\s*/, $input);), I get a blank element at the start. What am I doing
> wrong?

If you "perldoc -f split", you'll see:

  As a special case, specifying a PATTERN of space (' ') will split on
  white space just as "split" with no arguments does.

So try:

  my @tmp = split(" ",$input);



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

Date: Wed, 5 Nov 2003 16:01:45 -0000
From: "Richard S Beckett" <spikeywan@bigfoot.com.delete.this.bit>
Subject: Re: Split problem.
Message-Id: <bob704$3gq$1@newshost.mot.com>

> > Guys,

> > I have a line of text like this " 5 6 0 7 176

> > 0". i.e. 9 spaces before the 5.

> > When I try to place the numbers into an array with split (my @temp =
split

> > (/\s*/, $input);), I get a blank element at the start. What am I doing

> > wrong?



> If a list is separated by colons like this:

> 1:2:3:4:5

> then we can agree on that there are five items in the list.

> What about this list then:

> :1:2:3:4:5

> Perl believes that the first element is an empty element since

> we've separatedt it from the second element, which is '1'.

> The "solution" would be to remove all flanking separators:

> $list =~ s/^:*//;

> $list =~ s/:*$//;

> and then split it

> @arr = split /:/, $list;

> This applies to your choise of seperator as well.

Aaaaaaah!

Thanks Andreas.

R.




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

Date: Wed, 5 Nov 2003 11:53:14 -0500
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
To: Richard S Beckett <spikeywan@bigfoot.com>
Subject: Re: Split problem.
Message-Id: <Pine.SGI.3.96.1031105114702.45805B-100000@vcmr-64.server.rpi.edu>

[posted & mailed]

On Wed, 5 Nov 2003, Richard S Beckett wrote:

>I have a line of text like this "         5    6       0        7   176
>0". i.e. 9 spaces before the 5.
>
>When I try to place the numbers into an array with split (my @temp = split
>(/\s*/, $input);), I get a blank element at the start. What am I doing
>wrong?

The thing you're doing wrong doesn't have to do with the leading empty
field.  You should be using split(/\s+/, $input), because \s* will match
ZERO spaces (which is why '176' is split into 1, 7, and 6).

The split function WILL return empty leading fields if they exist, so
using split(/\s+/, $input) will still return an empty leading field.

However, there's a special case:  split(' ', $input).  This will split on
multiple spaces, AND ignore a leading empty field.

-- 
Jeff Pinyan            RPI Acacia Brother #734            2003 Rush Chairman
"And I vos head of Gestapo for ten     | Michael Palin (as Heinrich Bimmler)
 years.  Ah!  Five years!  Nein!  No!  | in: The North Minehead Bye-Election
 Oh.  Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)



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

Date: Wed, 5 Nov 2003 16:48:12 -0000
From: "Richard S Beckett" <spikeywan@bigfoot.com.delete.this.bit>
Subject: Re: Split problem.
Message-Id: <bob9n6$7at$1@newshost.mot.com>

> If you "perldoc -f split", you'll see:
>   As a special case, specifying a PATTERN of space (' ') will split on
>   white space just as "split" with no arguments does.
> So try:
>   my @tmp = split(" ",$input);

I did read it, but didn't really understand it. Sorry.

So you're saying that:
my @tmp = split(" ",$input);

is the equivalent of:
$input =~ s/^\s*//;
my @tmp = split (/\s+/, $input);

?

The thing that threw me was that there are different numbers of spaces
between the numbers in $input, so I didn't think that would work.

Thanks.

R.




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

Date: Wed, 5 Nov 2003 17:36:47 +0000 (UTC)
From: "John J. Trammell" <trammell+usenet@hypersloth.invalid>
Subject: Re: Split problem.
Message-Id: <slrnbqid9f.jol.trammell+usenet@hypersloth.el-swifto.com.invalid>

[attributions fixed]
On Wed, 5 Nov 2003 16:48:12 -0000, Richard S Beckett wrote:
> [Trammell wrote:]
>> If you "perldoc -f split", you'll see:
>>   As a special case, specifying a PATTERN of space (' ') will split on
>>   white space just as "split" with no arguments does.
>> So try:
>>   my @tmp = split(" ",$input);
> 
> I did read it, but didn't really understand it. Sorry.
> 
> So you're saying that:
> my @tmp = split(" ",$input);
> 
> is the equivalent of:
> $input =~ s/^\s*//;
> my @tmp = split (/\s+/, $input);
> 
> ?

Again from perldoc -f split:

  A "split" on "/\s+/" is like a "split(' ')" except that any leading
  whitespace produces a null first field.  A "split" with no arguments
  really does a "split(' ', $_)" internally.

ph33r my 1337 perldoc sk33lz!



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

Date: Wed, 05 Nov 2003 18:52:05 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: Splitting an array into "even" parts
Message-Id: <pan.2003.11.05.16.53.29.83430@aursand.no>

On Wed, 05 Nov 2003 13:52:42 +0000, Anno Siegel wrote:
> sub split_array {
>     my $parts = shift || 2;
>     my @array = @{ shift()};
>     my $size = int @array/$parts;
>     my $rem = @array % $parts;
>     map [splice @array, 0, $size + ($rem-- > 0)], 1 .. $parts;
> }

Most excellent.  Seems to do excactly what I am looking for.  Thanks a
lot, Anno!


-- 
Tore Aursand <tore@aursand.no>


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

Date: Wed, 05 Nov 2003 15:28:32 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: Verbose warnings
Message-Id: <vqi5p0lrt2dk1b@corp.supernews.com>

In article <bo97c0$9ra$06$1@news.t-online.com>,
    Richard Voss  <erutiurf@web.de> wrote:

: Greg Bacon wrote:
:
: > Here's a start:
: > [...]
:
: that will only work with package variables, not with lexicals.
: 
: I recommend the debugger.

So?  The OP said he's dealing with package variables.

Greg
-- 
Let me say that I wholeheartedly disagree with the notion that women
should gain control of the world.  We cannot afford an entitlement
program for shoes.
    -- Joseph Sabia


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

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


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