[9115] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2733 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 27 08:08:04 1998

Date: Wed, 27 May 98 05:01:06 -0700
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, 27 May 1998     Volume: 8 Number: 2733

Today's topics:
    Re: -e under NT and UNIX (Michael Armstrong)
        About libnet.so.092 <cowboy@tkgis.tku.edu.tw>
    Re: ASP vs CGI <zkessin@lhr-sys.dhl.com>
    Re: ASP vs CGI <perlguy@inlink.com>
    Re: c.l.p.misc is `perl support' (was Re: O'Reilly has  (David Adler)
    Re: Clearly define "free software" (Stefaan A Eeckels)
        DBM and FreeBSD <rshadian@hawaii.edu>
        DialUp and Drive mapping on Windows NT? <ctsen@ccg.uc.pt>
    Re: DialUp and Drive mapping on Windows NT? (/\oo/\ the original)
    Re: DialUp and Drive mapping on Windows NT? <jdf@pobox.com>
        Don't Know how to decrypt using PERL <michaely@hills.alphanet.net.au>
    Re: Don't Know how to decrypt using PERL (Michael Fowler)
    Re: Good with pattern matches? <jdf@pobox.com>
    Re: Good with pattern matches? (brian d foy)
    Re: Handling Dates Help Please johnny99@sydney.dialix.oz.au
    Re: Handling Dates Help Please (M.J.T. Guy)
    Re: Handling Dates Help Please (brian d foy)
        How can I get the system memory size of my system(Linux mikpf@hotmail.com
    Re: list context: || vs or (Mark-Jason Dominus)
    Re: list context: || vs or <tchrist@mox.perl.com>
        Listening to a modem..... <stuartg.pcrsys@minorplanet.com>
        Net::FTP and passwords <alex@aloud.com>
    Re: Problem reading large files under Win95 <david@solbors.no>
    Re: Problem reading large files under Win95 <quednauf@nortel.co.uk>
        Rand on NT perl gbm@my-dejanews.com
    Re: regexp to delete trailing spaces? <andy@wonderworks.co.uk>
        regexp: normalizing csv data? <rdschramm@earthlink.net>
    Re: SECURITY - simple perlscript for taking orders (brian d foy)
    Re: Sendmail to alias from Perl CGI script? (Holger Hellmuth)
    Re: stuck on perl (J|rgen P|nter)
    Re: system question (Mark-Jason Dominus)
        text to RTF file converting using Perl <LeonS@amdocs.com>
    Re: Xor computation (Stefaan A Eeckels)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 27 May 1998 05:05:51 GMT
From: michaela@phosphor.com (Michael Armstrong)
Subject: Re: -e under NT and UNIX
Message-Id: <35729c75.25531562@news.visi.com>

On 26 May 1998 17:26:07 GMT, daniel.mendyke@digital.com (Daniel) spake
thusly:

>My development system is NT using ISS ver 3.
>if I run the line 
>'print qq(it's here!) if -e $image;'
>from the command line it works.  But when
>calling up the script through a browser it
>doesn't.  

I don't think you really need something to convert / and \ in your
path names. 

Check that the directory path for the file is accessible to the user
ID that the Web server runs as. Like Unix, NT is persnickity about
file/directory permissions. 

Also check that $image (or $fileName) has the correct information in
it. I have seen people get stuck on NT systems that have multiple
drives or the directory paths aren't what the script is assuming they
should be. I.e. does the script gets run with D:\somedir as current
directory when the file in question is in C:\tmp\otherdir\? That would
result in an absolute path of D:\tmp\images\thing.gif for your
specified relative path of /tmp/images/thing.gif 

---
Michael Armstrong
michaela@phosphor.com                     http://www.phosphor.com/

         Full service Web design and Internet consulting


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

Date: 27 May 1998 10:17:21 GMT
From: Chia-Hao Chang <cowboy@tkgis.tku.edu.tw>
Subject: About libnet.so.092
Message-Id: <6kgp7h$45o@super.tku.edu.tw>

As Title!
when I run my perl program,there is an error message! 
message is as follow:
ld.so failed: Can't find shared library "libnet.so.0.92"
Operating System: FreeBSD 3.0
Perl Version : 5.00404
Could somebody give me a hand :)
Thanks in advance! 


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

Date: 27 May 1998 09:59:00 +0100
From: Zachary Kessin <zkessin@lhr-sys.dhl.com>
Subject: Re: ASP vs CGI
Message-Id: <wsqogwkm6nf.fsf@webdev.dhl.com>


"Neil Marshall" <marshaln@shaw.wave.ca> writes:

> Hello!  I am asked to do an investigation in server-side programming
> language.  I read articles and get an impression that ASP is a more
> powerful tool and a less learning curve than CGI.  Is that true?  Fairy
> story?  However, what I want from you PERL experts are Pro's and Con's of
> PERL programming.  It would refect a decision making to choose the right
> programming language to suit with user and system requirements.
> 
> Thanks,
> 
> Neil  

A few factors, ASP is exclusivly a Microsoft technology. So you have
to use an NT server (which you may have been going to do anyway). And
you can do ASP is perl. (I dont know how but I know you can). Perl has
somewhat of a learning curve but not to bad, and there is a lot of
good stuff pre written for perl like CGI.pm (Which does a lot of the
hard stuff in CGI for you.) Or Embperl, which lets you embed perl in
html so if you have a page that is all static except for say one popup
menu you can design it like that. 

What other requirements do you have? Do you need to talk to a database
and what kind? 


BTW Perl and CGI are not the same thing, you can write CGI's in any
language, but perl works best. And you can use perl for much more than
CGI.


--Zach
Good Luck


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

Date: Wed, 27 May 1998 10:45:38 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: ASP vs CGI
Message-Id: <356BEED2.5880A08D@inlink.com>

There are no CONS with Perl!   :-)

Brent


I use Perl on UNIX and NT systems.  I am able to move my code with
minimal changes.  (Usually just path information changes.)

I can also use Perl to easily make calls programs on the system that I
am using.  Or to connect to databases, or to perform system
administration tasks, or to make things easier for my users, ... 

I have found nothing better, more powerful, or more straightforward than
Perl.

Good luck!


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

Date: 27 May 1998 08:29:19 GMT
From: dha@panix.com (David Adler)
Subject: Re: c.l.p.misc is `perl support' (was Re: O'Reilly has helped promote the acceptance of Perl)
Message-Id: <6kgisv$65f@news1.panix.com>

On Tue, 26 May 1998 02:14:25 GMT, Randal Schwartz <merlyn@stonehenge.com> wrote:
>>>>>> "Russell" == Russell Schulz <Russell_Schulz@locutus.ofB.ORG> writes:
>
>Russell> a. a book is `support'?
>Russell> b. usenet is `support'?!
>
>Russell> please clarify.
>
>Please clarify your need for clarification.  It seems mighty clear to
>me, and to the thousands of others that turn to my books and Usenet
>every day for help.

I don't believe it.  *You* need *help*?  ;-)

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Chicken Wire?" - Lou Marini


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

Date: 27 May 1998 08:05:38 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: Clearly define "free software"
Message-Id: <6kghgi$12i$1@justus.ecc.lu>

In article <u1hd8d0o46f.fsf@biohazard-cafe.mit.edu>,
	tb@mit.edu (Thomas Bushnell, n/BSG) writes:
> I believe that Klaus Schilling is referring to the opinion attributed
> to Socrates in Plato's _Meno_.  I don't personally believe the theory,
> but it's got something in its credit--especially with regard to
> mathematical constructs--like, say, computer programs.  (Something, of
> course, is a lot less than everything; don't expect me to start
> defending the _Meno_.)

Now I know why your organisation is called the:

	Organization: Massachvsetts Institvte of Technology

Pining for the past ;-) 
(And yes, I know that the Romans used 'v' for 'u', and the
 two gentlemen are commonly considered to be Greek. 
 Sometimes a classical education has its uses :-)

-- 
Stefaan
-- 

PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
   Williams and Holland's Law:  If enough data is collected,
          anything may be proven by statistical methods.


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

Date: Tue, 26 May 1998 23:01:05 -1000
From: Ritchard Shadian <rshadian@hawaii.edu>
Subject: DBM and FreeBSD
Message-Id: <Pine.GSO.3.95q.980526224514.7804A-100000@uhunix3>

I don't know a whole lot about the various types of DBM files.  All I know
is that when I used a dbmopen() call in my script, I was able to take the 
data in a hash and store it in two files with .pag/.dir extensions.

That was on a Linux machine.  When I use the exact same script on a
FreeBSD machine, it creates one file with a .db extension and doesn't find
the .dir/.pag files.

I want to read from the same database files that I had on my Linux
machine.  How can I get Perl to use the .dir/.pag files instead of the .db
file?  I don't want to re-enter all the data again.  I know there's
different kinds of DBMs, like GDBM, DB, NDBM, and ODBM, but I don't know
which one I was using.  Also I tried all the use directives: GDBM_File,
DB_File, NDBM_File, and AnyDBM_File, but I couldn't get it to produce the
 .pag/.dir files like before.  Is there a way to use the old format on BSD?
Or is there a simple way to convert the data between DBM types?  Any help
would be appreciated.

Ritchard
------------------------------------------------------------------------------
Procrastinator's Proverb: Never do today what can be put off until tomorrow.
******



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

Date: Wed, 27 May 1998 11:22:10 +0100
From: Carlos Araujo <ctsen@ccg.uc.pt>
Subject: DialUp and Drive mapping on Windows NT?
Message-Id: <356BE952.816D856B@ccg.uc.pt>

Hi everyone,

I've got some questions:

- How can I make a Dial up Connection from a Nt Workstation to a Nt
Server?

- How can I map a Remote directory?

- Where can I find the NET:: package?

Thank U.

Tsen.



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

Date: Wed, 27 May 1998 11:07:30 GMT
From: WarezSpider@Warez.web/\oo/\ (/\oo/\ the original)
Subject: Re: DialUp and Drive mapping on Windows NT?
Message-Id: <356df5fe.54775310@news.sgi.net>

We use VPN (Virtual Private Networking) to connect via dial-up
connection that "tunnels" under the Internet. Don't know if that was
the type you meant or if you want to really dial using the modem/s.
Once you connect via VPN you can Map a Network/ed drive as usual.
The NET:: package would probably be on CSPAN
or perl.com 

Hope this was a little helpful

/\oo/\


On Wed, 27 May 1998 11:22:10 +0100, Carlos Araujo <ctsen@ccg.uc.pt>
wrote:

>Hi everyone,
>
>I've got some questions:
>
>- How can I make a Dial up Connection from a Nt Workstation to a Nt
>Server?
>
>- How can I map a Remote directory?
>
>- Where can I find the NET:: package?
>
>Thank U.
>
>Tsen.



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

Date: 27 May 1998 07:36:23 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: DialUp and Drive mapping on Windows NT?
Message-Id: <yavnq4ag.fsf@mailhost.panix.com>

WarezSpider@Warez.web/\oo/\ (/\oo/\ the original) writes:

> The NET:: package would probably be on CSPAN

Tonight's top story: we examine how *you* can find out for yourself
whether a given element is in an array.  Also: a physicist at UC
Berkeley claims to have found a general law for evaluating list
operators in scalar context.  Later tonight, a roundtable discussion
on the free software community.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Wed, 27 May 1998 17:54:22 +1000
From: "Michael Yeung" <michaely@hills.alphanet.net.au>
Subject: Don't Know how to decrypt using PERL
Message-Id: <6kgh05$ifm$1@nswpull.telstra.net>

Hi all,

Crypt function encrypts a string using DES algorithm, Right ?

I have created some unreadable password using Crypt function with the salt
like :

result = crypt(plaintext , salt) ;

I want to know if there is a way to decrypt the result and give back the
plaintext !

Any help/suggestions will be appreciated !

Thanks !

regards,
MIKE




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

Date: Wed, 27 May 1998 09:09:22 GMT
From: wolfm@pobox.alaska.net (Michael Fowler)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6LQa1.30$0z3.613891@binary.alaska.net>

The simple answer is you can't.  crypt, from what I understand (and have
witnessed) is a wrapper around the unix crypt(3) function, which is one way. 
This means it encrypts it into a string that has so many possibilities that it
is effectively un-decryptable.

If given the unencrypted string you can encrypt it, using the encrypted
string as the salt, and compare it.  The point is to encrypt passwords.  You
don't want anyone to be able to decrypt them.


Respectfully,
Michael


On Wed, 27 May 1998 17:54:22 +1000, Michael Yeung
<michaely@hills.alphanet.net.au> bespoke regarding Don't Know how to decrypt
using PERL:
>Hi all,
>
>Crypt function encrypts a string using DES algorithm, Right ?
>
>I have created some unreadable password using Crypt function with the salt
>like :
>
>result = crypt(plaintext , salt) ;
>
>I want to know if there is a way to decrypt the result and give back the
>plaintext !
>
>Any help/suggestions will be appreciated !
>
>Thanks !
>
>regards,
>MIKE
>
>


-- 


--                                   --
All my life I wanted to be someone;
I guess I should've been more specific.
--                                   --




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

Date: 27 May 1998 07:23:06 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Good with pattern matches?
Message-Id: <zpg3q4wl.fsf@mailhost.panix.com>

tadmc@flash.net (Tad McClellan) writes:

> Ed Egan (ed@vtrad.com) wrote:
> 
> : I need a patern match to match:
> 
> : "D*****"  or "****\D\*****" or "*****\D"
> 
>    /D\w{5}|\w{4}\\D\w{5}|\w{5}\\D/;
                    ^^
    insert \\ between these marks to match that second \

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Wed, 27 May 1998 07:44:10 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Good with pattern matches?
Message-Id: <comdog-ya02408000R2705980744100001@news.panix.com>
Keywords: from just another new york perl hacker

In article <jr0gk6.lab.ln@localhost>, tadmc@flash.net (Tad McClellan) posted:

>Ed Egan (ed@vtrad.com) wrote:
>
>: I need a patern match to match:
>
>: "D*****"  or "****\D\*****" or "*****\D"
>
>: where * is a any alphanumeric and the "\" is a character to be
>: matched.
>
>
>   /D\w{5}|\w{4}\\D\w{5}|\w{5}\\D/;

hmmm... a lot of backtracking if the second pattern doesn't fails.

and it matches things like

   Djust another new york perl hacker

or

   D_____

which weren't supposed to match :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>


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

Date: Wed, 27 May 1998 06:12:50 GMT
From: johnny99@sydney.dialix.oz.au
Subject: Re: Handling Dates Help Please
Message-Id: <6kgat2$5s0$1@nnrp1.dejanews.com>


> Ala Qumsieh <aqumsieh@matrox.com> posted:

># Previous day
>$day--;
>if ($day == 0) {
>    $month--;
>    # set $day to either 30 or 31 (maybe even 28/29 in the case of February)
>depending on month
>}

>Was that hard to figure out?

Not at all -- I can also picture, say, a routine with a 365-item array each
containing a filename for each day of the year with an if-clause for leapyears
(and a second if-clause for the year 2000 of course) with its own 365-item
array...but it's that kind of work I wanted to avoid... if only there was some
way to -- but wait...


(brian d foy) wrote:

>    #!/usr/bin/perl
>    use subs qw(make_file_name);
>
>    $\ = "\n";
>
>    @yesterday = localtime(time - 24 * 60 * 60);
>    @tomorrow  = localtime(time + 24 * 60 * 60);
>
>    print "Yesterday's file is ", make_file_name(\@yesterday);
>    print "Today's file is ", make_file_name([localtime]);
>    print "Tomorrow's file is ", make_file_name(\@tomorrow);
>
>    sub make_file_name
>       {
>       my $array_ref = shift;
>
>       $$array_ref[4]++;        #month - zero based
>       $$array_ref[5] += 1900;  #year - offset from 1900
>
>       "$$array_ref[5]-$$array_ref[4]-$$array_ref[3].html";
>       }
>
>    __END__

Brian, you're a legend...

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 27 May 1998 09:31:55 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Handling Dates Help Please
Message-Id: <6kgmib$90a$1@lyra.csx.cam.ac.uk>
Keywords: from just another new york perl hacker

brian d foy <comdog@computerdog.com> wrote:
>
>looks like a lot of work.  rather than spend one's time coding date
>algorithms, just jump right to the functionality :)
>
>   #!/usr/bin/perl
>   use subs qw(make_file_name);
>   
>   $\ = "\n";
>   
>   @yesterday = localtime(time - 24 * 60 * 60);
>   @tomorrow  = localtime(time + 24 * 60 * 60);
   [ snip ]

But that won't do the right thing if you catch it at the wrong moment
near a daylight saving change.    Some days have 23 hours and some 25.


Mike Guy


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

Date: Wed, 27 May 1998 07:40:22 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Handling Dates Help Please
Message-Id: <comdog-ya02408000R2705980740220001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6kgmib$90a$1@lyra.csx.cam.ac.uk>, mjtg@cus.cam.ac.uk (M.J.T. Guy) posted:

>brian d foy <comdog@computerdog.com> wrote:
>>
>>looks like a lot of work.  rather than spend one's time coding date
>>algorithms, just jump right to the functionality :)
>>
>>   #!/usr/bin/perl
>>   use subs qw(make_file_name);
>>   
>>   $\ = "\n";
>>   
>>   @yesterday = localtime(time - 24 * 60 * 60);
>>   @tomorrow  = localtime(time + 24 * 60 * 60);
>   [ snip ]
>
>But that won't do the right thing if you catch it at the wrong moment
>near a daylight saving change.    Some days have 23 hours and some 25.

don't run it at midnight.  i like to run my cron jobs around 3 in the
morning :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>


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

Date: Wed, 27 May 1998 10:17:14 GMT
From: mikpf@hotmail.com
Subject: How can I get the system memory size of my system(Linux)
Message-Id: <6kgp78$mo9$1@nnrp1.dejanews.com>

Thanks,

Jong


jong@salt2.med.harvard.edu

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 27 May 1998 02:05:08 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: list context: || vs or
Message-Id: <6kgaek$5ga$1@monet.op.net>
Keywords: meadowland racetrack riddance tilt


In article <FPIa1.189$_3.1145421@news2.voicenet.com>,
Matt Knecht <hex@voicenet.com> wrote:
>I am using the term 'list' and 'array' interchangably. The
>documentation also seems to use them interchangably. 

Yeah, it's a shame.

>AHA!  So, a list is like a local or auto variable in C.  It has relevance as
>long as we're in this stack frame, and as soon as the function
>returns, it's gone?

No, not really.  Perl doesn't have anything like a C auto variable.
But there is a C analogy.  C has this distinction between `objects'
and `values'.  A variable `x' is an object.  There is part of the
computer's memory reserved for it.  You can write `x = 6' and `x++'.
But 4 isn't an object; it's not stored anywhere, and `4 = 6' and `4++'
are nonsensical.  `Objects' are often called `lvalues'.

If you meditate on the difference between these two sorts of things,
you have the essence of the distinction between arrays and lists in
Perl.

In Perl, an array is an object, and a list is the value that you might
put in it.  

>If this is so, when do we ever see 'lists' in Perl?  When stat()
>returns it's values, aren't they given storage somewhere as an array?

Not necessarily.  Think of this C function:

	int square(int n) { return n*n; }

You call square(3), you get a 9 back, but the 9 isn't really stored
anywhere, or at least nowhere that's any of your business.  If you write

	square(3);

then that 9 is gone forever.  If you want it to survive, you have to
store it somewhere.

>If not, how can they survive after stat() has gone out of context?

Perl `stat' is the same. The list isn't really anywhere until you
assign it into a (possibly anonymous) array variable.

>Even if the elements of a list only exist on a stack somewhere, why
>can't we count them?

What, is this a trick question?  Why can't you compute the gamma
function with the getprotoent() builtin?  Why doesn't `read' return -1
to indicate an error?  Why can't you get the number of outstanding
references to a variable?  Because that's not the way it is, that's
why not.  If you don't like it, submit a patch.

>>    If you want to program in C, program in C.  It's a nice language.  I
>>    use it occasionally...   :-)
>>            --Larry Wall in <7577@jpl-devvax.JPL.NASA.GOV>
>
>How apropos. :)

He does that on purpose.


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

Date: 27 May 1998 06:39:03 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: list context: || vs or
Message-Id: <6kgce7$h5e$1@csnews.cs.colorado.edu>
Keywords: meadowland racetrack riddance tilt

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    mjd@op.net (Mark-Jason Dominus) writes:
:>>    If you want to program in C, program in C.  It's a nice language.  I
:>>    use it occasionally...   :-)
:>>            --Larry Wall in <7577@jpl-devvax.JPL.NASA.GOV>
:>
:>How apropos. :)
:
:He does that on purpose.

I suppose I could, but I certainly didn't.

--tom
-- 
Whom computers would destroy, they must first drive mad.


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

Date: Wed, 27 May 1998 09:48:01 +0100
From: "Stuart Grimshaw" <stuartg.pcrsys@minorplanet.com>
Subject: Listening to a modem.....
Message-Id: <6kgk0f$gi3$1@svr-c-01.core.theplanet.net>

I'm having trouble getting Perl to have a conversation with my modem...

I open the port thus :-

    open(MODEM, "+>COM2");

and can get it to dial the number...

    print(MODEM "ATDT 0973100602")

but can I get it to listen to the characters coming in...

I've tried all sorts, mainly variations on....

 while (<>)
 {
   read(MODEM, $tmp,7);
   if (index($tmp,"conn") > 0) {print $tmp};
 }






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

Date: Wed, 27 May 1998 11:22:24 GMT
From: "Aloud.com" <alex@aloud.com>
Subject: Net::FTP and passwords
Message-Id: <356BF761.39EDF491@aloud.com>

Hi,

I've been using NET::ftp for a while but I'm slightly concerned about
the logging in section.
You obviously have to give the name and password of the system you are
FTPing to. Is there anyway to encrypt this line or use to hide the
passwords?

$ftp->login('user','password');

Thanks
Alex



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

Date: Wed, 27 May 1998 10:45:36 +0200
From: David Carter <david@solbors.no>
Subject: Re: Problem reading large files under Win95
Message-Id: <356BD2B0.CF833376@solbors.no>

Marc Haber wrote:
> 
> David Carter <david@solbors.no> wrote:
> >> I have a problem with big files under  Win95.
> >>
> >> The problem is that I can read only the first 4-5 Mb from the file (total length is 25 Mb).
> >> It works well by splitting the file in some little files of 4 Mb.
> >>
> >> Is this a Perl limitation ? Or Win95 ? On Perl under Win95 ?
> >> Had anybody else this problem ? A solution ?
> >
> >FDISK is what you need.
> 
> Would you care to explain your answer please? If you don't, I would
> consider it misleading if not dangerous.

I think WinWoes95 is more dangerous.


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

Date: Wed, 27 May 1998 11:04:56 +0100
From: "Frank L. Quednau" <quednauf@nortel.co.uk>
Subject: Re: Problem reading large files under Win95
Message-Id: <356BE547.A545498F@nortel.co.uk>

David Carter wrote:

> Hi,
>
> > I have a problem with big files under  Win95.
> >
> > The problem is that I can read only the first 4-5 Mb from the file (total length is 25 Mb).
> > It works well by splitting the file in some little files of 4 Mb.
> >
> > Is this a Perl limitation ? Or Win95 ? On Perl under Win95 ?
> > Had anybody else this problem ? A solution ?
>
> FDISK is what you need.

FDISK is a DOS program, not? You defy your own argumentation. Don't you sometimes think that we
all should have a brain FDISK? Well, I'd prefer Partition Magic, though.

--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________





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

Date: Wed, 27 May 1998 11:06:41 GMT
From: gbm@my-dejanews.com
Subject: Rand on NT perl
Message-Id: <6kgs41$qom$1@nnrp1.dejanews.com>

Hi,
I have problems running the rand function on NT perl.
When I run the function $number = int(rand 5) I allways get the same number
in $number.
I tryed it with the command line and on the NT server and I get the same
result.
Is there a bug with the function or do I need to use another one?

Cheers,

Guillaume.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 26 May 1998 22:38:26 +0100
From: Andy Armstrong <andy@wonderworks.co.uk>
Subject: Re: regexp to delete trailing spaces?
Message-Id: <EKM8WHASZza1Ews+@wndrwrks.demon.co.uk>

In article <6kf8vj$sb2$1@news.doit.wisc.edu>, Ross Yahnke
<rcyahnke@doit.wisc.edu> writes
>Hi all - A newbie question here, what's a useful regexp to delete all the
>trailing spaces in a string?
>
>I.e., I want to change:
>    "All that glitters               "
>
>...to...
>    "All that glitters"

Without wishing to be difficult you'll be doing yourself a *huge* favour
if you take the time to find out how this stuff works for yourself.
Anyway, to answer your specific query:

 s/ +$//;

but I expect you meant whitespace (including TABs), in which case you
want

 s/\s+$//;

-- 
** Don't CC any follow-ups to me - I *do* read the newsgroups I post to **
Andy Armstrong, Wonderworks, http://www.wonderworks.co.uk


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

Date: Wed, 27 May 1998 06:20:24 -0400
From: <rdschramm@earthlink.net>
Subject: regexp: normalizing csv data?
Message-Id: <6kgpip$ltb$1@bolivia.it.earthlink.net>

Hi,

I have been given the output of a an export utility for a mail package.
This output contains basically a user dump from one mail system.  I have
been asked to reformat the data so it can be imported into a second mail
package.

The problem is that the mail package exported the data as comma delimited
fields, except when the field data contained a comma whereby they qualify
that data with a quotes.  What I get is a data set like the following:

f1,f2,f3,f4,f5
f1,"f2a,f2b",f3,f4,f5

This causes me numerous problems trying parse the data correctly.  The
solution I came up with was a "normalize" sub that massages the data before
I try to parse.  That subroutine is below.  The problem that I am having
with that sub is:

1. It takes two passes - normalizing only every other field since I must
include the delimiters as part of the regexp.
2. It does not work properly if the data contains more than 1 comma per
field.

Neither of these has been an issue with my specific problem to date, but I
know it is not optimal and want to find out how to make it better.  Any
suggestions on how to improve the follow would be greatly appreciated.
BTW, I know the $_ and $line stuff below is wacky - it was late when I
finished the routine and I was too lazy to clean it up.

sub normalize {

 ($line) = pop(@_);
 $_ = $line;

 # Matches anything except quotes and commas
 # between commas.

 if ($_ !~ /^"/) { $_ =~ s/^([^"|^\,]+)\,/\"$1\"\,/ }
 $_ =~ s/\,([^"\,]*)\,/\,\"$1\"\,/g;
 $_ =~ s/\,([^"\,]*)$/\,\"$1\"/;

 # This goes back the second time and matches the ones missed above.
 while($_ =~ /\,[^"\,]*\,/) {
  $_ =~ s/\,([^"\,]*)\,/\,\"$1\"\,/g;
 }


 return($_);
}




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

Date: Wed, 27 May 1998 07:47:20 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: SECURITY - simple perlscript for taking orders
Message-Id: <comdog-ya02408000R2705980747200001@news.panix.com>
Keywords: from just another new york perl hacker

>On Tue, 26 May 1998 23:43:13 GMT, Peter A Fein <p-fein@uchicago.edu>
>wrote:

>>An important (non-perl) tip is to make sure that your script does not
>>have read privleges enabled for all (ie, web) users.  You'll need
>>execute privileges of course, but if someone can d/l your script,
>>it'll be a lot easier for them to find holes.In article 

<356e8d0d.27905563@news.sgi.net>, WarezSpider@Warez.web/\oo/\ (/\oo/\ the original) posted:

>If you place it in a active CGI-BIN this is usually no problem as it
>will inheriet the execute only writes of the folder and the "virtual"
>folder won't allow downloads unless of course your the Administrator!


i've never heard of uploaded files automagically inheriting certain
characteristics based on their location inthe file system.  perhaps
your umask or the local copy of wuftpd is configure that way, but it
certainly is not a universal thing.

check your permissions.  :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>


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

Date: 27 May 1998 11:41:56 GMT
From: Holger.Hellmuth@ira.uka.de (Holger Hellmuth)
Subject: Re: Sendmail to alias from Perl CGI script?
Message-Id: <6kgu64$bgc$1@nz12.rz.uni-karlsruhe.de>

"Noel Sampol" <noels@chilli.net.au> writes:

>open(MAIL, "|$mailprog $email");
>print MAIL ("From: .....      etc etc

>where $mailprog = "/usr/bin/sendmail";
>and $email is the e-mail address that a visitor has typed in the HTTP form.

I hope you check $email for shell special characters, before you give
it to the open statement, otherwise you might get problems with
malevolent visitors inserting `rm...` there.

>Also, I can't seem to provide parameters in the form "-X logfilename" as in
>open(MAIL, "|$mailprog $email -X logfilename");

how about: $mailprog -X logfilename $email

						Holger.








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

Date: 27 May 1998 05:47:23 GMT
From: Juergen.Puenter@materna.de (J|rgen P|nter)
Subject: Re: stuck on perl
Message-Id: <6kg9db$6i3$1@penthesilea.Materna.DE>

In article <356A8D0F.C3F9B268@cs.uwa.edu.au>, hugo@cs.uwa.edu.au says...
>
>Could someone please put me out of my misery and help me out?  I am
>after the solution to the excersise at the following site:
>
>http://www.uni-hohenheim.de/institute/rz/app/prg/perl/perl/filehandling.html#exe
>rcise

As per the exercise:
prior to the print-statement add this: $" = "#";
and change: print @lines; 
        to: print "#@lines";

$" sets the value for the list-separator (roughly: what to print 
between list-elements if interpolated into a double-quoted string;
see Programming Perl, 2nd ed., page 133 for details).

"#@lines" sets the necessary double-quotes and prints a # on the
first line of the output, just before the first element from 
@lines (otherwise the first line would not begin with #).

BTW, this is of course only one way to accomplish this output.
You could easily do the same with a foreach-loop (perhaps even
easier to understand for a beginner than $"). 

HTH
  Juergen Puenter



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

Date: 27 May 1998 01:53:07 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: system question
Message-Id: <6kg9o3$5fi$1@monet.op.net>
Keywords: Abel antenna Mahoney McCall


In article <356B2A9F.6CBB@angelfire.com>,
the count  <eglamkowski@angelfire.com> wrote:
>@ARGV = ('-') unless @ARGV;
>while ($ARGV = shift) {
>    system "dos2unix $ARGV > tmp;mv tmp $ARGV";
>}

Uh, that first line doesn't make any sense in this context.  It works
OK with <>, but you're not using <> here.  If you run this program
without arguments, it's gonna put the output in a file named `-',
assuming that dos2unix even recognizes the `-' convention and reads
from the right place.


>But then I had the idea:  what if I could generalize this to run
>ANY command on a bunch of files?
>Any pointers on how to go about doing this?

Well, it depends on how high-level you want the `this' to be.  For
example, you might use:

	$COMMAND = shift 
	  or die "Usage: $0 COMMAND files...\n";

	if (@ARGV) {
	  foreach $file (@ARGV) {
	    my $command = $COMMAND;
	    $command =~ s/FILE/$file/;
	    system $command;
	  }
	} else {  # STDIN
	  # Omitted because it's tricky
	}

Then you invoke it like this:

	apply 'rev FILE' file1 file2 file3

But that sends output to stdout, rather as if you'd done
	cat file1 file2 file3 | rev

Maybe you want it to replace the files in-place.  Then maybe a better
design is to assume that the command will read stdin and write stdout:

	foreach $file (@ARGV) {
	  my $data = qx{$command < $file};
	  open F, $file or warn: Couldn't modify file `$file': $!; skipping\n";
	  print F $data;
	}

Then to number the lines in many files you'd use

	apply 'cat -n' *

This design also makes it easier to get the stdin-stdout behavior
right:

	if (@ARGV) { 
	  # as above
	} else { # stdin/stdout
	  exec $command or die "Couldn't exec `$command': $!.\n";
	}

It's not really clear that this is useful.  Maybe you need to look at
the `for' and `foreach' commands that are built into your shell
instead.


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

Date: Wed, 27 May 1998 08:08:21 +0300
From: Leon Shaigorodsky <LeonS@amdocs.com>
Subject: text to RTF file converting using Perl
Message-Id: <356B9FC4.BF9A0AD2@amdocs.com>

Hi,
How can i convert predefined text file to RTF format.
Or how can i make RTF file (what is the specification of it)
May be some package already exist ?

Thank you



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

Date: 27 May 1998 08:09:05 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: Xor computation
Message-Id: <6kghn1$12i$2@justus.ecc.lu>

In article <6kffb4$c4h$3@csnews.cs.colorado.edu>,
	Tom Christiansen <tchrist@mox.perl.com> writes:
> Maybe he'd rather do:
>     $a ^= $b;
>     $b ^= $a;
>     $a ^= $b;
> 
> as an easier to read substitute for 
>     ($a, $b) = ($b, $a);


Oh no, not the 'how to swap two integers without using
a temporary variable' thread *all* *over* *again*.


-- 
Stefaan
-- 

PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
   Williams and Holland's Law:  If enough data is collected,
          anything may be proven by statistical methods.


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 2733
**************************************

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