[18611] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 779 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 27 11:05:56 2001

Date: Fri, 27 Apr 2001 08:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <988383911-v10-i779@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 27 Apr 2001     Volume: 10 Number: 779

Today's topics:
    Re: accessing hard drive via webpage (Rudolf Polzer)
    Re: Accessing other servers in cgi without LWP <bart.lateur@skynet.be>
    Re: Accessing other servers in cgi without LWP (Rudolf Polzer)
        ANNOUNCE: Data::Denter 0.10 <ingy@ActiveState.com>
        ANNOUNCE: Lingua::EN::Inflect 1.87 (Damian Conway)
    Re: Appending to files and flock. <bart.lateur@skynet.be>
    Re: Appending to files and flock. (Anno Siegel)
    Re: Appending to files and flock. <taka@yarn.demon.co.uk>
    Re: Appending to files and flock. <taka@yarn.demon.co.uk>
    Re: Appending to files and flock. (Anno Siegel)
    Re: binary operations <rayj00@yahoo.com>
    Re: building Perl 5.6.0 with a custom @INC (Andy Dougherty)
    Re: compile (Tad McClellan)
        Finding all elements in an array matching a certian cri <hillr@ugs.com>
    Re: Functional equivant to =~ operator? nobull@mail.com
    Re: Help:  PPM on unix? <sthomas@ws5120.nc.fnc.fujitsu.com>
        help: time difference <dbadba62@hotmail.com>
    Re: help: time difference <vmurphy@Cisco.Com>
    Re: help: time difference <andras@mortgagestats.com>
        Levels of perl programming <sthomas@ws5120.nc.fnc.fujitsu.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 27 Apr 2001 16:52:53 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: accessing hard drive via webpage
Message-Id: <slrn9ej1u5.7b6.eins@www42.t-offline.de>

Gregory Toomey <gtoomey@usa.net> wrote:
> No it's not.
> 
> The question was whether this can be done in Perl.

You use perl for catching the data. But, I know, only Perl is not 
enough. You cannot even display something bold in someone's browser just 
using Perl - you have to use CGI and HTML, too ;)

> 
> gtoomey
> ---------
> "Einhardschule Seligenstadt" <webmaster@einhardschule.de> wrote in message
> news:9c8gcd$u17$03$1@news.t-online.com...
> >
> > Craig Berry <cberry@cinenet.net> schrieb in im Newsbeitrag:
> > teebtsqe6r240e@corp.supernews.com...
> > > mathieu.barroussel (mathieu.barroussel@ntlworld.com) wrote:
> > > : I need to write a cgi (Perl or C) that, from my web page, enables me
> to
> > > : access the c:\ hard drive or just one program, on a remote PC. Is this
> > > : possible?
> >
> > Yes it is possible. Thx IE 5.5 ;)
> 
> 
> 


-- 
#!/usr/bin/perl -W -- WARNING: This will print 22,307 bytes! <strictsafe!>
use strict;for(my$y=-1;$y<1;$y+=.1){for(my$x=-1.9;$x<.4;$x+=.03){print'+';
my$X=my$Y=0;for(0..99){($X,$Y)=($X*$X-$Y*$Y+$x,2*$X*$Y+$y);print"\b "if$X*
$X+$Y*$Y>9;}}print"\n"};print''.reverse"\nHPAJ \a!rezloP .R yb torblednaM"


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

Date: Fri, 27 Apr 2001 10:51:27 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Accessing other servers in cgi without LWP
Message-Id: <uljiet437olr9bcbk54e5l3hg30l9naih1@4ax.com>

Bart Lateur wrote:

>But, I'd advice you to check out samples on how to get a page through
>HTTP using Telnet alone. If you see what you're supposed to send, and
>how the server responds, it's not hard to put something together using
>bare sockets that works for simple cases like this.

As for the bare sockets part, you should check out item 55 in Joseph N.
Hall's book, "Effective PErl PRogramming". This particular item, 8 pages
in all, is available online as a PDF file, from the book's website:
<www.effectiveperl.com>.

Also take note of his advice there, starting with the title: "Know when,
and when not, to write networking code.". Unless you're getting a course
in bare metal TCP/IP programming, your teacher is a moron on forbidding
you to use modules. If he did so.

-- 
	Bart.


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

Date: Fri, 27 Apr 2001 16:55:40 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: Accessing other servers in cgi without LWP
Message-Id: <slrn9ej23c.7b6.eins@www42.t-offline.de>

Bert DeBoer <bertdb@iinet.net.au> wrote:
> For part of an assignment I have to write a cgi script that receives a text file
> from another server and does something with it. Essentially if I can get the
> following working, I can do what I want:
> 
> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print "<HTML>\n";
> print "<HEAD>\n";
> print "<TITLE>Welcome</TITLE>\n";
> print "</HEAD>\n";
> print "<BODY>\n";
> 
> $url='http://www.server.com/directory/file.txt';
> $content = &get($url);
> print "$content\n"
> 
> print "</BODY>\n";
> print "</HTML>\n";
> 
> Now in the assignment we are not allowed to use any external programs. At the
> moment my design is implemented with 'wget' but I have to replace this with the
> low level HTTP protocol requests. We are also NOT allowed to use MODULES, and
> every example I find that does something like this uses LWP from the
> libwww-perl-5.53 library. I have tried to understand the module Simple.pm and
> write my own code, but it needs 14 other modules, and all that code pasted
> together gives about a 300k text file. This is way too much to learn for the
> assignment. I need a group of simple subroutines (and packages if required) that
> can be pasted below the above code to make it work. Simple error handling can be
> achieved by checking if $content is empty or something similar. The file
> retrieved is always a text file.

Contact the server
send this:

GET /path/to/html/file/or/script.cgi HTTP/1.0\n\n

and load the answer using your socket. Not really clean because you 
are not sending any headers, but normally it works.


-- 
#!/usr/bin/perl -W -- WARNING: This will print 22,307 bytes! <strictsafe!>
use strict;for(my$y=-1;$y<1;$y+=.1){for(my$x=-1.9;$x<.4;$x+=.03){print'+';
my$X=my$Y=0;for(0..99){($X,$Y)=($X*$X-$Y*$Y+$x,2*$X*$Y+$y);print"\b "if$X*
$X+$Y*$Y>9;}}print"\n"};print''.reverse"\nHPAJ \a!rezloP .R yb torblednaM"


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

Date: Fri, 27 Apr 2001 09:18:22 GMT
From: Brian Ingerson <ingy@ActiveState.com>
Subject: ANNOUNCE: Data::Denter 0.10
Message-Id: <teirnupr5vu28@corp.supernews.com>

Data::Denter - An alternative to Data::Dumper and Storable.

INTRODUCTION:

Data::Denter is yet another Perl data serializer/deserializer. It
formats nested data structures in an indented fashion. It is optimized
for human readability/editability, safe deserialization, and
(eventually) speed.

NOTE: It may be optimized for Python programmers too, but please don't
hold that against me ;)

It exports 2 functions: C<Indent()> and C<Undent()> for serialization
and deserialization respectively. It handles all of the commonly
serializable Perl data types, including: scalars, hash refs, array
refs, scalar refs, ref refs, undef, and blessed references. It can
even properly handle circular and duplicate references.

SAMPLE:

     use Data::Denter;
     print Indent bless {foo => 42,
                         bar => [ 'happy', undef, [], 'sad' ],
                         baz => "Bozo the Clown",
                        }, "Small::Example";

yields:

     %Small::Example
         baz => Bozo the Clown
         bar => @
             happy
             ?
             @
             sad
         foo => 42

INFORMATION:

For more information on Data::Denter, see 'perldoc Data::Denter'.

Please send questions and comments to "Brian Ingerson" <INGY@cpan.org>

Copyright (c) 2001, Brian Ingerson. All Rights Reserved.




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

Date: 26 Apr 2001 03:22:51 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: Lingua::EN::Inflect 1.87
Message-Id: <teiro5eg7dja2e@corp.supernews.com>
Keywords: perl, module, release

==============================================================================
                Release of version 1.87 of Lingua::EN::Inflect
==============================================================================

DESCRIPTION

The exportable subroutines of Lingua::EN::Inflect provide plural
inflections and "a"/"an" selection for English words.

Plural forms of all nouns, most verbs, and some adjectives are
provided. Where appropriate, "classical" variants (for example:
"brother" -> "brethren", "dogma" -> "dogmata", etc.) are also
provided.

Pronunciation-based "a"/"an" selection is provided for all English
words, and most initialisms.

Lingua::EN::Inflect also provides facilities for comparing 
words in a "number-insensitive" manner (that is, an eq-like
comparison in which "ox" and "oxen" compare equal).

In generating these inflections, Lingua::EN::Inflect follows the
Oxford English Dictionary and the guidelines in Fowler's Modern
English Usage, preferring the former where the two disagree.

The module is built around standard British spelling, but is
designed to cope with common American variants as well. Slang,
jargon, and other English dialects are *not* explicitly catered
for. However, the module does provide the ability to define new
plural forms (or redefine existing ones).

Where two or more inflected forms exist for a single word
(typically a "classical" form and a "modern" form), by default
Lingua::EN::Inflect returns the more common form (typically the
"modern" one). The programmer can, however, specify that
"classical" plurals should be preferred.


==============================================================================

CHANGES IN VERSION 1.87


	- Innumerable individual word fixes (thanks Shevek)

	- Added classical '-ix' -> '-ices' (thanks again Shevek)

	- Generalized handling of postfix adjectives like "Postmaster General"
	  and "courts martial" (thanks Steve)

	- Added many other nationalities: "Javanese", "Timorese", etc.
	  (thanks Jarrko)

	- Added "eyas" (thanks Jarrko)

	- Unified Inflect.pm and Inflect.pod


==============================================================================

AVAILABILITY

Lingua::EN::Inflect has been uploaded to the CPAN
and is also available from:

	http://www.csse.monash.edu.au/~damian/CPAN/Lingua-EN-Inflect.tar.gz

==============================================================================




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

Date: Fri, 27 Apr 2001 10:07:53 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Appending to files and flock.
Message-Id: <q5hietk6dbgqa3drv7584tfsgsan0rsr2q@4ax.com>

Paul the Nomad wrote:

>open (FH, ">> results.txt");
>print FH $result;
>close FH;
>
>However, the author of this code doesn't lock the file at all.  Surely
>as a CGI you might get many attempts to append to the file at the same
>time.  My question is shouldn't flock be used here?  Or is there
>something about 'print FH ...' that makes it atomic?

No, it's something about ">>". This garantees that writing to this file
will append the data at the end of the file. If the data to print is
small enough, you may be pretty sure it won't ever be corrupted. But
don't bet your life on it.

BTW on those platforms that don't support flock(), i.e. those doing
autolock when opening a file for writing, the open() will fail if
somebody else has the file open. Funny that this code doesn't check the
success of the open() call.

-- 
	Bart.


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

Date: 27 Apr 2001 13:59:49 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Appending to files and flock.
Message-Id: <9cbu0l$3lc$1@mamenchi.zrz.TU-Berlin.DE>

According to Paul the Nomad  <taka@yarn.demon.co.uk>:
> abigail@foad.org (Abigail) writes:
> 
> > Paul the Nomad (taka@yarn.demon.co.uk) wrote on MMDCCXCV September
> > MCMXCIII in <URL:news:87ae53fya8.fsf@euterpe.yarn.demon.co.uk>:
> > \\  abigail@foad.org (Abigail) writes:
> > \\  
> > \\ > Paul the Nomad (taka@yarn.demon.co.uk) wrote on MMDCCXCV September
> > \\ > MCMXCIII in <URL:news:87oftk0w2a.fsf@euterpe.yarn.demon.co.uk>:
> > \\ > ;;  
> > \\ > ;;  
> > \\ > ;;  I've just been looking at someone's code for a very basic survey/poll
> > \\ > ;;  cgi.  You know, the sort of thing that you see on Slashdot.
> > \\ > ;;  
> > \\ > ;;  Every time someone votes the result is appended to a file...something
> > \\ > ;;  like this:
> > \\ > ;;  
> > \\ > ;;  open (FH, ">> results.txt");
> > \\ > ;;  print FH $result;
> > \\ > ;;  close FH;
> > \\ > ;;  
> > \\ > ;;  However, the author of this code doesn't lock the file at
> all.  Surely
> > \\ > ;;  as a CGI you might get many attempts to append to the file at
> the same
> > \\ > ;;  time.  My question is shouldn't flock be used here?  Or is there
> > \\ > ;;  something about 'print FH ...' that makes it atomic?
> > \\ > 
> > \\ > 
> > \\ > No, it's something about the open mode.
> > \\ > 
> > \\ > 
> > \\ > Did you study perlopentut?
> > \\ > 
> > \\  
> > \\  Eh??? That just says the way to lock is to use flock and using lock
> > \\  files may cause race conditions.
> > 
> > 
> > Locking isn't involved here, now is it?
> > 
> 
> What we want to ensure is our exclusive access to a file while we
> append to it.

No, what we want to ensure is that every log entry is added to the
end of the file.

> > perlopentut will tell you about the relation of Perls open, and the
> > system calls. If you then look up the documentation of the system calls
> > you should pay attention to the mode the file is opened.
> > 
> 
> In the code I was talking about the author used just normal 'open' and
> not 'sysopen'.  In any case, opening the file with sysopen does not

No-one was talking about sysopen.  Perl's open uses system calls to
do its thing.  For some details you will have to refer to *their*
documentation.

> lock it.  In fact, a quick look at my system's man page shows that the
> C system call 'open' doesn't support locking.  It does say, however,
> that if two or more people try to append to a file at the same time it
> could corrupt the file.

Not if the individual bits written aren't exceedingly large.  This has
all been hashed out in other parts of this thread.  Please read it.

Anno


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

Date: 27 Apr 2001 15:47:05 +0100
From: Paul the Nomad <taka@yarn.demon.co.uk>
Subject: Re: Appending to files and flock.
Message-Id: <87ae52bdsm.fsf@euterpe.yarn.demon.co.uk>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:

> According to Paul the Nomad  <taka@yarn.demon.co.uk>:
> > abigail@foad.org (Abigail) writes:
> > 
> > > Paul the Nomad (taka@yarn.demon.co.uk) wrote on MMDCCXCV September
> > > MCMXCIII in <URL:news:87ae53fya8.fsf@euterpe.yarn.demon.co.uk>:
> > > \\  abigail@foad.org (Abigail) writes:
> > > \\  
> > > \\ > Paul the Nomad (taka@yarn.demon.co.uk) wrote on MMDCCXCV September
> > > \\ > MCMXCIII in <URL:news:87oftk0w2a.fsf@euterpe.yarn.demon.co.uk>:
> > > \\ > ;;  
> > > \\ > ;;  
> > > \\ > ;;  I've just been looking at someone's code for a very basic survey/poll
> > > \\ > ;;  cgi.  You know, the sort of thing that you see on Slashdot.
> > > \\ > ;;  
> > > \\ > ;;  Every time someone votes the result is appended to a file...something
> > > \\ > ;;  like this:
> > > \\ > ;;  
> > > \\ > ;;  open (FH, ">> results.txt");
> > > \\ > ;;  print FH $result;
> > > \\ > ;;  close FH;
> > > \\ > ;;  
> > > \\ > ;;  However, the author of this code doesn't lock the file at
> > all.  Surely
> > > \\ > ;;  as a CGI you might get many attempts to append to the file at
> > the same
> > > \\ > ;;  time.  My question is shouldn't flock be used here?  Or is there
> > > \\ > ;;  something about 'print FH ...' that makes it atomic?
> > > \\ > 
> > > \\ > 
> > > \\ > No, it's something about the open mode.
> > > \\ > 
> > > \\ > 
> > > \\ > Did you study perlopentut?
> > > \\ > 
> > > \\  
> > > \\  Eh??? That just says the way to lock is to use flock and using lock
> > > \\  files may cause race conditions.
> > > 
> > > 
> > > Locking isn't involved here, now is it?
> > > 
> > 
> > What we want to ensure is our exclusive access to a file while we
> > append to it.
> 
> No, what we want to ensure is that every log entry is added to the
> end of the file.

 ...while ensuring that the file isn't corrupted

> 
> > > perlopentut will tell you about the relation of Perls open, and the
> > > system calls. If you then look up the documentation of the system calls
> > > you should pay attention to the mode the file is opened.
> > > 
> > 
> > In the code I was talking about the author used just normal 'open' and
> > not 'sysopen'.  In any case, opening the file with sysopen does not
> 
> No-one was talking about sysopen.  Perl's open uses system calls to
> do its thing.  For some details you will have to refer to *their*
> documentation.
> 
> > lock it.  In fact, a quick look at my system's man page shows that the
> > C system call 'open' doesn't support locking.  It does say, however,
> > that if two or more people try to append to a file at the same time it
> > could corrupt the file.
> 
> Not if the individual bits written aren't exceedingly large.  This has

Sounds like programming by wishful thinking.

> all been hashed out in other parts of this thread.  Please read it.
> 
> Anno

-- 
-----------
Paul 
   http://www.seditiousdiaries.com/Donald10.html


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

Date: 27 Apr 2001 15:53:58 +0100
From: Paul the Nomad <taka@yarn.demon.co.uk>
Subject: Re: Appending to files and flock.
Message-Id: <8766fqbdh5.fsf@euterpe.yarn.demon.co.uk>

Bart Lateur <bart.lateur@skynet.be> writes:

> Paul the Nomad wrote:
> 
> >open (FH, ">> results.txt");
> >print FH $result;
> >close FH;
> >
> >However, the author of this code doesn't lock the file at all.  Surely
> >as a CGI you might get many attempts to append to the file at the same
> >time.  My question is shouldn't flock be used here?  Or is there
> >something about 'print FH ...' that makes it atomic?
> 
> No, it's something about ">>". This garantees that writing to this file
> will append the data at the end of the file. If the data to print is
> small enough, you may be pretty sure it won't ever be corrupted. But
> don't bet your life on it.

Therefore should use flock.

> 
> BTW on those platforms that don't support flock(), i.e. those doing
> autolock when opening a file for writing, the open() will fail if
> somebody else has the file open. Funny that this code doesn't check the
> success of the open() call.
> 

It doesn't.  I've been experimenting on my platform and so far I have
been able to open the file numerous times for writing.  So despite
what other people in this thread have been saying, I'm using flock.

> -- 
> 	Bart.

-- 
-----------
Paul 
   http://www.seditiousdiaries.com/Donald10.html


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

Date: 27 Apr 2001 15:03:54 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Appending to files and flock.
Message-Id: <9cc1oq$3lc$2@mamenchi.zrz.TU-Berlin.DE>

According to Paul the Nomad  <taka@yarn.demon.co.uk>:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
[oops, lost an attribution there]

> > > lock it.  In fact, a quick look at my system's man page shows that the
> > > C system call 'open' doesn't support locking.  It does say, however,
> > > that if two or more people try to append to a file at the same time it
> > > could corrupt the file.
> > 
> > Not if the individual bits written aren't exceedingly large.  This has
> 
> Sounds like programming by wishful thinking.

Is Rabin/Miller prime testing programming by wishful thinking?

It's called choosing the right tool for a task.  Nothing stops
you from additionally locking if the application is critical.

Anno


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

Date: Fri, 27 Apr 2001 09:50:27 -0400
From: RayJ <rayj00@yahoo.com>
Subject: Re: binary operations
Message-Id: <3AE97923.10901@yahoo.com>

I bet I do too!

What I want to do is take a hex value, say a5.
Turn a5 into 10100101 binary. Then I may want to
look at bit's 4 and 5 to see what the 2 bit value is
(00,01,10,11), or just look at bit 2 or bits 2-5, etc.

I should mention I'm not a programmer per-se. I did do
some assembly programming a few years ago on a proprietary
telecommunication system.

Thanks,

Ray

Abigail wrote:

 
> I bet you fail to understand what the value of an array in scalar 
> context is. I also fail to see the intend of your code.
> 
> 
> Abigail



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

Date: Fri, 27 Apr 2001 14:40:05 -0000
From: doughera@maxwell.phys.lafayette.edu (Andy Dougherty)
Subject: Re: building Perl 5.6.0 with a custom @INC
Message-Id: <slrn9ej18n.esr.doughera@maxwell.phys.lafayette.edu>

In article <3AE91562.BAFF13E1@ceverett.com>, Christopher L. Everett wrote:
>How?  It works with 5.6.1 where ./Configure asks 
>if I want to have any other directories added to 
>the @INC, but the ./Configure for 5.6.0 doesn't 
>ask the question.  I tried to edit the config.sh
>to add a line "otherlibdirs=/usr/share/perl5"
>but it doesn't get added to @INC, despite what it 
>says in the INSTALL file.

Correct.  That's a bug in 5.6.0 that should be fixed in 5.6.1.  If you
want to back-port the fix to 5.6.0, you need to copy the otherlibdirs
stuff from 5.6.1's config_h.SH and perl.c and paste them into the
5.6.0 versions of those files.  Then go and add your otherlibdirs line
to config.sh, run sh Configure -S; make depend; make.  It should
work then.

Hope this help,

-- 
    Andy Dougherty		doughera@lafayette.edu
    Dept. of Physics
    Lafayette College, Easton PA 18042


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

Date: Fri, 27 Apr 2001 07:55:53 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: compile
Message-Id: <slrn9eini9.3q7.tadmc@tadmc26.august.net>

Daniel Heiserer <daniel.heiserer@bmw.de> wrote:

>is there a way to compile/precompile perl and perl/Tk code 
                   ^^^^^^^

   perldoc -q compile

You are expected to check the Perl FAQ *before* you post to the
Perl newsgroup.


>so:
>a) it is faster at execution time


No. Compiling will only make the compile time go away, runtime
will be the same.


>b) all the code is checked before


You can check syntax without compiling:

   perl -cw myprog


>c) I can hide what I am doing
          ^^^^

   perldoc -q hide

You are expected to check the Perl FAQ *before* you post to the
Perl newsgroup.


Missing one FAQ is believable. 

Missing multiple FAQs makes it appear that you did not look at the 
FAQ before posting.  That is the kind of thing that earns you a 
killfile entry. So long.


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


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

Date: Fri, 27 Apr 2001 07:44:38 -0700
From: Ron Hill <hillr@ugs.com>
Subject: Finding all elements in an array matching a certian criteria
Message-Id: <3AE985D6.BFCE4147@ugs.com>

Hi All,

I am trying to extract filenames from a directory based on userid. I
figured that the perl grep function
would work. However I am unabe to extract the filenames that I want. I
have constructed a hash with
the keys as the userid's. I retrive the dir listing and I want to
extract all filenames that contain
the userid. I have included a script of what I have tried. the array
@wanted is empty. Can anyone
tell me how this can be done?

Thanks

Ron Hill  


#!/app/perl5.005_03_static/bin/perl -w
use strict;

my %systems = (  'riches'  =>'1',
		 'loder'   =>'1',
		 'yamaguch'=>'1',
		 'gerlich' =>'1');
		 
my @allfiles=();
while (<DATA>)  {
chomp;
push (@allfiles,$_);
}


my @wanted = grep { /keys %systems_(.*)/ } @allfiles;

print @wanted;
__DATA__
jswade_1093207.toreview
loder_4257062.toreview
whitman_4229398.toreview
kjrangan_4269510.toreview
gerlich_4272527.toreview
yamaguch_new_1370.toreview
andersj_4272811.toreview
pdford_4273033.toreview
cowell_new_1482.toreview
jfwhite_new_1494.toreview
gerlich_new_1498.toreview
jfwhite_new_1495.toreview
fujiir_4272999.toreview
gerlich_new_1497.toreview
riches_4000097.toreview
schnurr_new_1487.toreview
brannon_4047079.toreview
riches_4239252.toreview
riches_4214803.toreview


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

Date: 27 Apr 2001 12:10:38 +0100
From: nobull@mail.com
Subject: Re: Functional equivant to =~ operator?
Message-Id: <u9zod2ha35.fsf@wcl-l.bham.ac.uk>

"Gregory Toomey" <gtoomey@usa.net> writes:

> Maybe I've missed something in my Perl readings, but this has me confused.
> 
> We can use the assignment
> $var1 =~ tr/a-z/A-Z/;

That is not an assignment.  That is a mutator.

> Is there an equivalent tr function? Something like
> $var2 = tr/a-z/A-Z/ ($var1);

You can do:

   ($var2 = $var1) =~ tr/a-z/A-Z/;

Or, of course, in this specific case:

   $var2 = uc $var1; # Also handles accented chatacters!

If you wish that the =~ syntax could adopt an idiom more like a
conventional function call...

  $var2 = apply { tr/a-z/A-Z/ } $var1;

 ...then please see the extensive thread earlier this week where many
of the leading lights of this newsgroup discuss this exact same
question at length.

Subject: Idiom: the expression of a copied & substituted string

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 27 Apr 2001 10:54:33 -0400
From: Samuel Thomas <sthomas@ws5120.nc.fnc.fujitsu.com>
Subject: Re: Help:  PPM on unix?
Message-Id: <tl6k846z93q.fsf@ws5120.nc.fnc.fujitsu.com>

> cpan
> 
more specifically,
perl -MCPAN -e 'shell'

-- 
                /\
Sam Thomas     /  \     "hello, sailor"
Ext 1161      /	** \    Nothing happens here.
	     /______\


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

Date: Fri, 27 Apr 2001 10:34:11 GMT
From: "news.bellatlantic.net" <dbadba62@hotmail.com>
Subject: help: time difference
Message-Id: <DWbG6.2015$Zd4.590646@typhoon1.ba-dsg.net>

I have ta string extracted from $_

time1=4/12/2001 13:21:30
time2 is the sysdate
what is the most efficient way to get the epoch seconds of this two times?

Thanks for your help




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

Date: 27 Apr 2001 09:39:01 -0400
From: Vinny Murphy <vmurphy@Cisco.Com>
Subject: Re: help: time difference
Message-Id: <m3k8465uoa.fsf@vpnrel.cisco.com>

"news.bellatlantic.net" <dbadba62@hotmail.com> writes:

> I have ta string extracted from $_
> 
> time1=4/12/2001 13:21:30
> time2 is the sysdate
> what is the most efficient way to get the epoch seconds of this two times?
> 

I am not sure how efficient it is, though I use it often, but look at
the Date::Manip package.  Date::Manip has a note about how to parse
seconds since the epoch.  You may want to look at this package.

-- 
Vinny


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

Date: Fri, 27 Apr 2001 09:38:18 -0400
From: Andras Malatinszky <andras@mortgagestats.com>
Subject: Re: help: time difference
Message-Id: <3AE9764A.CE87F36@mortgagestats.com>



"news.bellatlantic.net" wrote:

> I have ta string extracted from $_
>
> time1=4/12/2001 13:21:30
> time2 is the sysdate
> what is the most efficient way to get the epoch seconds of this two times?
>
> Thanks for your help

Check out the Time::Local module.

Andras



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

Date: 27 Apr 2001 10:42:27 -0400
From: Samuel Thomas <sthomas@ws5120.nc.fnc.fujitsu.com>
Subject: Levels of perl programming
Message-Id: <tl6n192z9nw.fsf@ws5120.nc.fnc.fujitsu.com>

I feel like and idiot for not being able to find this but
can anyone point me to the document that lists 7 or so 
levels of perl skill and how to tell which one you are?

Thanks
-- 
                /\
Sam Thomas     /  \     "hello, sailor"
Ext 1161      /	** \    Nothing happens here.
	     /______\


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

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


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