[17868] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 28 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 10 00:05:58 2001

Date: Tue, 9 Jan 2001 21: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)
Message-Id: <979103109-v10-i28@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 9 Jan 2001     Volume: 10 Number: 28

Today's topics:
    Re: A Socket Server Problem <rps@no_spam.hostedscripts.com>
    Re: ASCII to integer conversion <jhelman@wsb.com>
    Re: ASCII to integer conversion <uri@sysarch.com>
    Re: counting lines in a file <monty@primenet.com>
    Re: counting lines in a file <jhelman@wsb.com>
    Re: counting lines in a file <ssomneb@my-deja.com>
        crypt() on slackware doesn't work? bluearchtop@my-deja.com
        data problems <ben.graves@virgin.net>
    Re: File I/O giving weird results (David Efflandt)
    Re: HELP subroutines <jhelman@wsb.com>
        Help this newbie learn please :) <hafateltec@hotmail.com>
    Re: Help this newbie learn please :) <wyzelli@yahoo.com>
    Re: Mime parser <jagman98@home.com>
    Re: Mime parser <jagman98@home.com>
    Re: Mysterious Perl problem (Maggert)
    Re: Mysterious Perl problem <jhelman@wsb.com>
        PERL  MP3 <enigmabomb@home.spammers.must.die.a.horrible.death.com>
    Re: Problem connecting to POP3 server (Garry Williams)
        require <ng@fnmail.com>
    Re: system() method won't change directories! <wyzelli@yahoo.com>
    Re: system() method won't change directories! <tony_curtis32@yahoo.com>
    Re: Taking control <jhelman@wsb.com>
    Re: Taking control <wyzelli@yahoo.com>
        Untaint the following string. <adalessandro@odione.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 10 Jan 2001 02:17:55 GMT
From: "Brett Foster" <rps@no_spam.hostedscripts.com>
Subject: Re: A Socket Server Problem
Message-Id: <nDP66.256022$_5.57604093@news4.rdc1.on.home.com>

I find that it is better to rewrite code from memory, takes a little more
time however when it comes to writing large chunks code I'm much faster and
efficient.

Regards,
Brett Foster

"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:1n3j5t8n8d1pohs0hm5p16loibgfdc9np3@4ax.com...
> Brett Foster wrote:
>
> >I've writen a bunch of socket programs before, I use code that looks like
> >this:
> ...
> >Pardon any typos in there, I did this off the top of my head.
>
> Huh? Do yo ualways start again from scratch when you write a new
> variation on the same theme? What's wrong with cut'n'paste?
>
> --
> Bart.




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

Date: Wed, 10 Jan 2001 03:00:56 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: ASCII to integer conversion
Message-Id: <nnjn5t4q28ie4gbiff129tdk4tf3i8ibuk@4ax.com>

On Tue, 09 Jan 2001 23:36:13 +0100, Clifford Pennock
<cliff@*MYLASTNAMEHERE*.nl> wrote:

>Uri Guttman wrote:
>> 
>> then your program has a BUG in it. you didn't extract the number, you
>> extracted a string which starts with a number. it is YOUR fault, not
>> perl's. learn perl and stop thinking in c. scalars hold numbers or
>> strings and there is no need to explicitly convert them. it is on your
>> (the programmer's) head to make sure the data is meaningful in the
>> proper contxt.
>> 
>> sheesh!
>> 
>> uri
>
>Jesus Uri, read the f*cking thread. I'm not having any problems here
>with Perl nor do any of my Perl programs, I'm just pointing out that
>Perl's behavior can cause problems if you don't beware. With typecasting
>you get an error at compile time if your variable is of the wrong type.
>Perl's "I don't care 'cos there all scalars" can be cumbersome from time
>to time. You *always* have to take into account that Perl can handle
>something differently than you (or the user) expects.

These "problems" are present with any programming language, C, Perl,
COBOL, whatever.  The onus is on the programmer to make sure that the
supplied data meets with the needs of the next statement.  It doesn't
matter what language you're in, you still have to remember that if you
make it idiot-proof, somebody, somewhere, is busily constructing a
better idiot.

So you are looking for an integer in a data stream (file, console,
doesn't matter).  In C, you are correct, if you call atoi() on a
non-numeric sequence, the program is going to toss an exception and
die.  Such is the nature of typed languages.  In non-typed languages,
if you want an integer, it's your job to make sure that you got one
(regular expressions are here for a reason).  If you didn't, rethink
the interface.

I've spent more hours than I care to count trying to grok the many
different ways that a user can enter a phone number.  Dots, dashes,
parenthesis, slashes; It seems that no matter what you tell your user,
they will come up with something different.  The job of the programmer
is to compensate for that.  That's why we get paid the big bucks.

Just my 2 cents,
JH


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

Date: Wed, 10 Jan 2001 04:17:49 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: ASCII to integer conversion
Message-Id: <x7elyc59cj.fsf@home.sysarch.com>

>>>>> "CP" == Clifford Pennock <cliff@*MYLASTNAMEHERE*.nl> writes:

  CP> Oh jump of your soapbox, Uri. The quotes were not included to
  CP> indicate "strings" or whatever. Or do I now need to write my
  CP> english in Perl syntax also?

this is a perl newsgroup, not an english one. if you are refering to
values, typing the proper value is important. you were concerned with
converting strings to integers. you type what should be an integer value
as a string with quotes. that is not an accurate way to describing your
data. i have no idea what is going on in your head and PSI::ESP doesn't
always work so well. given the thread, you have to assume you had the
wrong format for the data.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 10 Jan 2001 03:11:28 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: counting lines in a file
Message-Id: <93gjt0$nq0$1@nnrp1.phx.gblx.net>

lpj91100@my-deja.com wrote:
> Does anybody have a perl script that counts the
> numbers of lines of a file, excluding blank lines
> and commented lines?

Yes.


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

Date: Wed, 10 Jan 2001 03:19:57 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: counting lines in a file
Message-Id: <grkn5t0sqhtrc0oaka7lulhmdjcn43sfl5@4ax.com>

On Tue, 09 Jan 2001 23:54:15 GMT, lpj91100@my-deja.com wrote:

>Hi,
>
>Does anybody have a perl script that counts the
>numbers of lines of a file, excluding blank lines
>and commented lines?

No, not on me, sorry.  But here's some ideas...

1. Open the file
2. Initialize our counter to 0
3. Read a line
4. If the line is blank or a comment, skip it.
5. Otherwise, increment the counter
6. Close file, read counter.

Or...

1. Open the file
2. Read a line
3. If the line is blank or a comment, skip it.
4. Otherwise, push the line into a storage array.
5. Close file when done.
5. Count the number of entries into the array.

Or...

1. Read the file into memory in one slurp
2. Use a regular expression to extract blank or comment lines
3. Count the lines (either using a regex or a split())

Pretty much your choice, but I'd suggest the first option.

JH



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

Date: Wed, 10 Jan 2001 03:41:59 GMT
From: John Galt <ssomneb@my-deja.com>
Subject: Re: counting lines in a file
Message-Id: <93glm6$s11$1@nnrp1.deja.com>

Try this.  The double if statement could probably be improved with a
better regex... have fun playing around with it (I'm sure its
efficiency can be improved).  It seemed to work for
me, though.



#!/usr/bin/perl
$file="filename.txt";
open FILENAME, $file or die "Cannot open $file for read: $!";
$count=0             #so that it will return "0" if there are no
                     #relevant lines
for (<FILENAME>) {
     chomp;
     if ($_) {
          if (!/#/){
               $count++;
          }
     }
}
print "$count/n";



Enjoy!


Sent via Deja.com
http://www.deja.com/


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

Date: Wed, 10 Jan 2001 03:02:30 GMT
From: bluearchtop@my-deja.com
Subject: crypt() on slackware doesn't work?
Message-Id: <93gjc3$q5v$1@nnrp1.deja.com>

Here's a really strange problem. I installed Perl 5.6 from src on my
slackware box. Everything worked fine and installed fine. However, it
seems the crypt() function doesn't work. A simple example:

print crypt('1234abcd','aa');

This does not print anything.

I even tried installing perl5.6 slackware binary. Same problem.  Has
anyone heard of this before. The libcrypt must be working, because
other OS components that use crypt are fine.

Any ideas?

Thanks.


Sent via Deja.com
http://www.deja.com/


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

Date: Wed, 10 Jan 2001 02:39:57 -0000
From: "Ben Graves" <ben.graves@virgin.net>
Subject: data problems
Message-Id: <t5nirml6elfmf8@gxsn.com>

My web server reports the time incorrectly for the area I live, could
someone tell me how to get the date and time and add six hours to this time.

I thought I had it working but if the time is changed it doesn't update the
date if the time goes past midnight.

Thanx for any help,

Ben





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

Date: Wed, 10 Jan 2001 02:22:56 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: File I/O giving weird results
Message-Id: <slrn95nhrs.hp3.efflandt@efflandt.xnet.com>

On Mon, 08 Jan 2001, fenderstratocaster@my-deja.com
<fenderstratocaster@my-deja.com> wrote:
>I'm trying to learn Perl from a book I bought at Barnes and Nobles, so
>I'm by far not an expert. Just some quick questions so I can understand
>this a little better.
>
>> Yes I agree the results are weird, reading from an append-only
>> filehandle should fail - not return garbage.
>
>So if I use:
>
>open(FREECELL, ">>C:/My Documents/freecell.txt");
>
>I should not read the file into a variable or an array? And by doing so
>I'm getting jibberish?

Right.  If you 'just' want to read a file you would open it as:

open(FREECELL, "C:/My Documents/freecell.txt");

or

open(FREECELL, "< C:/My Documents/freecell.txt");

If Windows allows unescaped spaces in filenames (I have no way to test
that), but you should also test it with something like || die "Can't open
freecell.txt: $!"; or some error subroutine.

>> You say you want the line to be delimited by ', ' but you do:
>>
>> print FREECELL "@array";
>>
>> By default this uses space a the delimiter. You need to explicitly use
>> join()...
>
>print FREECELL join(', ' @array);
>
>The above line should do the trick?

No, you forgot a comma:  print FREECELL join(', ', @array);

>And the best way for me to do the code in the first place would be just
>to open the file for writing using:
>
>open(FREECELL, ">C:/My Documents/freecell.txt");
>
>Then reading the file into the array, adding a number to the end of the
>array, sort it out, erase the file, then write the array back into it?

No, you cannot "read" a file opened for only writing.  But you can open it
for reading and writing.  Here is a working test example:

#!/usr/bin/perl -w
my $newvalue = shift;
my $file = 'test.txt';
if (-e $file) {
    # Existing file
    open(FREECELL,"+< $file") || die "Can't open $file: $!";
    $_ = <FREECELL>;
    chomp;
    my @array = sort {$a <=> $b} (split(/, /,$_), $newvalue);
    seek(FREECELL,0,0);
    truncate(FREECELL,0);
    print FREECELL join(', ', @array);
} else {
    # New file
    open(FREECELL,"> $file");
    print FREECELL $newvalue;
}
close FREECELL;


-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: Wed, 10 Jan 2001 03:29:15 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: HELP subroutines
Message-Id: <kmln5tge8kqeut0e6g1div5ehuhrgku411@4ax.com>

On Tue, 9 Jan 2001 11:14:19 -0600, "Enrico Ng" <ng@fnmail.com> wrote:

>also, these three subroutines are in different files
>schedule is in a file called schedule
>load_file is in a file called file
>in the main program I use require for schedule and file
>do I need another require statement in schedule for file?

Doubtful.  Why not post the relevant sections of your code,
particularly the calls to the subroutines as well as the statements
which set any variables passed to said routines?  This sounds like a
relatively straightforward debugging exercise.

JH



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

Date: Wed, 10 Jan 2001 14:22:25 +1000
From: "Mike McPherson" <hafateltec@hotmail.com>
Subject: Help this newbie learn please :)
Message-Id: <93go33$cho$1@brokaw.wa.com>

Ok first the code.

#!/usr/bin/perl -w
# Little snip I created to convert ASCII to Characters and vice-versa.
$what = (shift @ARGV);

if ($what eq 'ASCII') {
print "\nOption ASCII\n";print "\nPlease enter the ASCII Number you wish to
convert to a character --->";
$ascii = <STDIN>;
$convert_ascii = chr($ascii);
print "\nYour conversion is chr/($ascii) equals $convert_ascii\n";
} elsif ($what eq 'CHAR') {
print "\nOption CHAR\n";
print "\nPlease enter the Character you wish to convert to ASCII --->";
$char = <STDIN>;
$convert_char = ord($char);
print "\nYour conversion is $char equals $convert_char\n";
}
else {
die "\nUsage ASCII or CHAR: $!\n";
}

At the command line if I run $>perl ascii2char.pl ASCII or $>perl
ascii2char.pl CHAR the program works as it should... However when i run
$>perl ascii2char.pl alone I get:

Use of uninitialized value at ascii2char.pl line 5.
Use of uninitialized value at ascii2char.pl line 10.

Usage ASCII or CHAR:

which is ok however I would like to hae it only say "Usage ASCII or CHAR: "

any help from here on greatly appriciated.





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

Date: Wed, 10 Jan 2001 14:43:25 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Help this newbie learn please :)
Message-Id: <x3S66.22$Mx3.9572@vic.nntp.telstra.net>

"Mike McPherson" <hafateltec@hotmail.com> wrote in message
news:93go33$cho$1@brokaw.wa.com...
> Ok first the code.
>
> #!/usr/bin/perl -w
> # Little snip I created to convert ASCII to Characters and vice-versa.
> $what = (shift @ARGV);
>
> if ($what eq 'ASCII') {

You are testing to see if $what eq ASCII without seeing if $what is
defined first.  If the script was called with no arguments, then $what
will be uninitialised, hence your error.

You should think of a way to only test if $what has been set to be ASCII
if either $what has been defined, or maybe if @ARGV has been defined.

A common way would be to test for @ARGV first, and if unset, go to the
sub which reports correct usage immediately, rather than using any
undefined variables.

if (@ARGV){
    $what = (shift @ARGV);
}
else {
    die "\nUsage ASCII or CHAR: $!\n";
}

and remove the else block from the end of your code.

You also want to start using indenting which will make your code much
easier to maintain.

Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;




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

Date: Wed, 10 Jan 2001 02:11:55 GMT
From: Manny <jagman98@home.com>
Subject: Re: Mime parser
Message-Id: <3A5BC4F9.B5775A7@home.com>

I am tryign to decode a mime message from /var/mail files suing GBARR's
modules.  With this module I can read a message body but the mime tags and html
tags also comes with the body.  I needs to parse "mime tags" and "html tags"
for example:

> ------_=_NextPart_001_01C06C45.BBA162B6
> Content-Type: text/plain;
>         charset="iso-8859-1"
>
> assdasdasdasd
>
> ------_=_NextPart_001_01C06C45.BBA162B6
> Content-Type: text/html;
>         charset="iso-8859-1"
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;
> charset=iso-8859-1">
> <TITLE>None Stationery</TITLE>
>
> <META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>
> <BODY background=""
> style="COLOR: #000000; FONT-FAMILY: Courier New; FONT-SIZE: 11pt">
> <DIV><FONT size=3><SPAN
> class=369493018-22122000>assdasdasdasd</SPAN></FONT></DIV>
> <DIV><FONT color=#0000ff><FONT size=2></FONT></FONT><FONT
> color=#000000
> face=Courier
> size=2>-----------------------------------------&nbsp;</FONT></DIV>
> New">-------------------------------------&nbsp;</FONT></FONT></DIV>
> <DIV>&nbsp;</DIV></BODY></HTML>
>
> ------_=_NextPart_001_01C06C45.BBA162B6--
> #AR-Message-End            Do Not Delete This Line
>

Let me know if you have any suggestions.



Chris Fedde wrote:

> In article <3A5A779C.7F5621CF@home.com>, Manny  <jagman98@home.com> wrote:
> >I am trying to remove HTML and other MIME code from MIME message body
> >using MIME:Parser but the message still does not remove anything.
> >
> >Can someone post an example of parser code?
> >
> >Thanks in advance!
> >
>
> I'm confused by your question.  Are you asking if it is posible to create a
> mime format message that does not contain HTML or are you asking if it
> is posible to turn HTML into plain text?  Or am I completely missing the
> point?  Maybe if you described the scenario it might help me figure out
> what you are asking.
>
> chris
> --
>     This space intentionally left blank



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

Date: Wed, 10 Jan 2001 02:14:42 GMT
From: Manny <jagman98@home.com>
Subject: Re: Mime parser
Message-Id: <3A5BC5A1.2B8D57D5@home.com>

For example:  Just trying to parse "assdasdasdasd" text from message body.

Manny wrote:

> I am tryign to decode a mime message from /var/mail files suing GBARR's
> modules.  With this module I can read a message body but the mime tags and html
> tags also comes with the body.  I needs to parse "mime tags" and "html tags"
> for example:
>
> > ------_=_NextPart_001_01C06C45.BBA162B6
> > Content-Type: text/plain;
> >         charset="iso-8859-1"
> >
> > assdasdasdasd
> >
> > ------_=_NextPart_001_01C06C45.BBA162B6
> > Content-Type: text/html;
> >         charset="iso-8859-1"
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML><HEAD>
> > <META HTTP-EQUIV="Content-Type" CONTENT="text/html;
> > charset=iso-8859-1">
> > <TITLE>None Stationery</TITLE>
> >
> > <META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>
> > <BODY background=""
> > style="COLOR: #000000; FONT-FAMILY: Courier New; FONT-SIZE: 11pt">
> > <DIV><FONT size=3><SPAN
> > class=369493018-22122000>assdasdasdasd</SPAN></FONT></DIV>
> > <DIV><FONT color=#0000ff><FONT size=2></FONT></FONT><FONT
> > color=#000000
> > face=Courier
> > size=2>-----------------------------------------&nbsp;</FONT></DIV>
> > New">-------------------------------------&nbsp;</FONT></FONT></DIV>
> > <DIV>&nbsp;</DIV></BODY></HTML>
> >
> > ------_=_NextPart_001_01C06C45.BBA162B6--
> > #AR-Message-End            Do Not Delete This Line
> >
>
> Let me know if you have any suggestions.
>
> Chris Fedde wrote:
>
> > In article <3A5A779C.7F5621CF@home.com>, Manny  <jagman98@home.com> wrote:
> > >I am trying to remove HTML and other MIME code from MIME message body
> > >using MIME:Parser but the message still does not remove anything.
> > >
> > >Can someone post an example of parser code?
> > >
> > >Thanks in advance!
> > >
> >
> > I'm confused by your question.  Are you asking if it is posible to create a
> > mime format message that does not contain HTML or are you asking if it
> > is posible to turn HTML into plain text?  Or am I completely missing the
> > point?  Maybe if you described the scenario it might help me figure out
> > what you are asking.
> >
> > chris
> > --
> >     This space intentionally left blank



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

Date: Wed, 10 Jan 2001 03:08:59 GMT
From: mag@ionet.net (Maggert)
Subject: Re: Mysterious Perl problem
Message-Id: <3a5bd1f1.189984363@news.ionet.net>

On Tue, 09 Jan 2001 22:45:03 GMT, jos_hunter_9@my-deja.com wrote:

>hi guys,
>This is a strange problem that I face in my web-based CGI application
>of about 100,000 line of perl code. I work on Windows NT (service pack
>4). Server is IIS. And use oraperl to talk to Oracle7.0 database.
>The Perl interpreter arbitrarily crashes when certain links or buttons
>in the application are clicked. The behavior is very arbitrary. Some
>workarounds (some don't make sense but sometimes work) are :
>1. Click the offending link in a new browser window.
>2. Close the browser session and restart the application in a new
>browser session.
>3. Reboot the system.
>4. Wait an arbitrary amount of time and the problem goes away.
>5. Put exit(0) or gothere() or something insane like "$a=0" and then
>problems goes away.
>After that even if you undo the changes the problem goes away.
>It seems that on Unix platforms I don't see this problem. I have no
>clue why it crashes but I assume it is a memory related problem.
>Any thoughts will be appreciated.
>J
>
	Your problem is on line 56,301 as reported by Net:ESP version
3.02.005

Code?? Anything??




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

Date: Wed, 10 Jan 2001 03:41:16 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: Mysterious Perl problem
Message-Id: <5bmn5tgh0ih310ngs6irpibl9al9p0hkde@4ax.com>

On Tue, 09 Jan 2001 22:45:03 GMT, jos_hunter_9@my-deja.com wrote:

>hi guys,
>This is a strange problem that I face in my web-based CGI application
>of about 100,000 line of perl code.

Well, why not post your code and we'll help debug it?

Just kidding. :)

> I work on Windows NT (service pack
>4). Server is IIS. And use oraperl to talk to Oracle7.0 database.
>The Perl interpreter arbitrarily crashes when certain links or buttons
>in the application are clicked. The behavior is very arbitrary. Some
>workarounds (some don't make sense but sometimes work) are :
>1. Click the offending link in a new browser window.
>2. Close the browser session and restart the application in a new
>browser session.
>3. Reboot the system.
>4. Wait an arbitrary amount of time and the problem goes away.
>5. Put exit(0) or gothere() or something insane like "$a=0" and then
>problems goes away.
>After that even if you undo the changes the problem goes away.
>It seems that on Unix platforms I don't see this problem. I have no
>clue why it crashes but I assume it is a memory related problem.

What crashes?  The browser or the program on the server?  If it's the
browser, then the problem is most likely memory related.  Are you
sending a particularly large response (like > 1MB) to the client?  If
so, chances are that's your problem.  Chunk your responses to a couple
of hundred kilobytes max at a time and see if this solves your
problem.

If it's the server routine that dies, then that's another matter
entirely.

Hope this helps,
JH



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

Date: Wed, 10 Jan 2001 04:49:36 GMT
From: "En|gMaBoM" <enigmabomb@home.spammers.must.die.a.horrible.death.com>
Subject: PERL  MP3
Message-Id: <ARR66.119459$w35.20895589@news1.rdc1.nj.home.com>

I have started a project called PERLP3. I want to know if there is an Mp3 or
sound module I could use with perl. I tryed looking at the docs, there was
non, is this virgin ground im on?

Josh




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

Date: Wed, 10 Jan 2001 04:04:33 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Problem connecting to POP3 server
Message-Id: <lbR66.514$qi1.8599@eagle.america.net>

On Mon, 08 Jan 2001 14:12:44 -0500, Don <don@lclcan.com> wrote:
>
>Thanks for your assistance.  I did as you mentioned but I'm not sure if this
>helps me or adds to the mystery.  The message I get is:
>
>Cannot open mail server: Operation now in progress at mailtest.pl line 5.
>
>My insticts are telling me that this may not be 100% a perlproblem but might
>be related tothe OS.  I am using RedHat 7.0 and am serioulsy considering
>downgrading to 6.2 ad 7.0 has giving me headaches from
>time to time.

No clue, but this may help from the connect(3N) manual page:

     EINPROGRESS
               The socket is non-blocking and the connection can-
               not  be  completed  immediately. It is possible to
               select(3C) for completion by selecting the  socket
               for writing. However, this is only possible if the
               socket STREAMS module is the topmost module on the
               protocol  stack  with  a  write service procedure.
               This will be the normal case.

-- 
Garry Williams


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

Date: Tue, 9 Jan 2001 21:21:02 -0600
From: "Enrico Ng" <ng@fnmail.com>
Subject: require
Message-Id: <93gkf1$85d$1@newsx.cc.uic.edu>

I have a bunch of subroutines that I have organized in different files.
I use require in the main program to call a subroutine in a different file.
this works fine, but when that subroutine calls a subroutine thats in
another file, I get errors
"Malformed prototype"

Any Ideas?

--
Enrico Ng <ng@fnmail.com>




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

Date: Wed, 10 Jan 2001 11:50:55 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: system() method won't change directories!
Message-Id: <OxP66.13$Mx3.8859@vic.nntp.telstra.net>

<2obvious@my-deja.com> wrote in message
news:93gfau$n2c$1@nnrp1.deja.com...
> I'm a Windows 98 user who is trying to use the system() method to get
> into my c:\program files directory.  But I don't seem to be able to
get
> out of the c:\perl\bin directory.
>
> system("cd.."); doesn't change directories.  Nor does
> system("cd\progra~1");
>
> I know that the directory hasn't changed, because if I include
> system("dir >file.txt"); after either of the lines above, the contents
> of file.txt are always from the c:\perl\bin directory.
>

Well, it would, but only for the duration of the actual system command.
The environment of a sub-program (system) can not change the parent
(your script).

look into the Perl command 'chdir'

perldoc -f chdir

Wyzelli
--
@x='07411711511603209711011111610410111403208010111410803210409709910710
1114'=~/(...)/g;
print chr for @x;




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

Date: 09 Jan 2001 20:13:21 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: system() method won't change directories!
Message-Id: <87zoh09mta.fsf@limey.hpcc.uh.edu>

>> On Wed, 10 Jan 2001 01:53:36 GMT,
>> 2obvious@my-deja.com said:

> I'm a Windows 98 user who is trying to use the system()
> method to get into my c:\program files directory.  But I
> don't seem to be able to get out of the c:\perl\bin
> directory.

> system("cd.."); doesn't change directories.

Ah, but it does.

But only for the duration of the child process spawned by
the system() call.  The parent process (your program) is
unaffected by the child.

You can't do what you want this way.

Fortunately, "cd" is underlain by the chdir() call (or at
least I presume it is on Windows) which does do what you
want.

    perldoc -f chdir

hth
t
-- 
Eih bennek, eih blavek.


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

Date: Wed, 10 Jan 2001 03:36:20 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: Taking control
Message-Id: <44mn5t4e9k11260gmsnellvkdp39indl1h@4ax.com>

On 9 Jan 2001 20:09:27 GMT, "Fing Lamer" <flamer@primenet.com> wrote:

>My boss noticed people come to our web site but don't buy much of our
>stuff. So he asked me to write a program to:
>
>1. Make sure our site always comes first in search engine listings.
>
>2. Force people to come to our site even if another listing looks more
>attractive.
>
>3. Make them stay on our site until they buy something.
>
>4. Wipe out their hard disk if they leave without buying anything.
>
>Can this be done in Perl? Could you please post the code for this program?
>I hope it will be available for free even though it would make us a
>bazillion dollars. Thank you.

Why, yes.  I just uploaded the
GoToCustomersHouseAndThreatenChildrenWithMachete module to CPAN.  It
includes the ChargeCreditCardWithoutAuthorization method for your
convenience.

Hope this helps,
JH


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

Date: Wed, 10 Jan 2001 13:44:01 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Taking control
Message-Id: <QbR66.19$Mx3.9167@vic.nntp.telstra.net>

"Fing Lamer" <flamer@primenet.com> wrote in message
news:01c07a77$5d9ad920$LocalHost@webmaster...
> My boss noticed people come to our web site but don't buy much of our
> stuff. So he asked me to write a program to:
>
> 1. Make sure our site always comes first in search engine listings.

My site is always first so the best you can get is second.

> 2. Force people to come to our site even if another listing looks more
> attractive.

Better to install a proxy redirection in their PC, see point 4.

> 3. Make them stay on our site until they buy something.

Who cares how long they stay if they are buying lots of stuff anyway?
See point 4.

> 4. Wipe out their hard disk if they leave without buying anything.

Your Boss is particularly short sighted.  Why not simply get their
computer to send you lots of orders continually.  That way you will sell
stuff, and they will get stuff.... and stuff....

> Can this be done in Perl? Could you please post the code for this
program?
> I hope it will be available for free even though it would make us a
> bazillion dollars. Thank you.

How do you think I got so rich... *snort*

How come programmers who get paid big bucks only ever want to give their
'2 cents' to a discussion?

Just my 2 bucks...

Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;




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

Date: Tue, 9 Jan 2001 22:21:53 -0500
From: "Arthur Dalessandro" <adalessandro@odione.com>
Subject: Untaint the following string.
Message-Id: <t5nlai4ps6sc66@corp.supernews.com>

I have to untaint the following string, does anyone have any idea why this
is not working?
$dn = $1 if ($data =~ /^([ *,-\@\^\w.]+)$/);

where
$data = 'cn=^Group,ou=groups,ou=company,o=arius.com';
or $data = 'dn=cn=^Group Name, ou=groups, ou=company, o=arius.com';

-Art




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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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


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