[22630] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4851 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 16 03:05:53 2003

Date: Wed, 16 Apr 2003 00:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 16 Apr 2003     Volume: 10 Number: 4851

Today's topics:
    Re: $name=<STDIN> problem (David Efflandt)
        ActiveState vs. CPAN modules <samj@austarmetro.com.au>
    Re: ActiveState vs. CPAN modules <knuteNOSPAMPLEASE@trinityproject.org>
        another problem. <mail@annuna.com>
    Re: another problem. <jkeen@concentric.net>
    Re: Beginners qn about while loops/regex (The Giant Flaming Penis In The Sky)
    Re: Beginners qn about while loops/regex <uri@stemsystems.com>
    Re: Delete line based on the next. <abigail@abigail.nl>
    Re: Delete line based on the next. (Tad McClellan)
    Re: GD::Graph-How to display string instead of values o <mgjv@tradingpost.com.au>
    Re: grep in array <wksmith@optonline.net>
    Re: How to compare 2 data files? <jurgenex@hotmail.com>
    Re: keys function not printing keys in debugger (qanda)
    Re: need finding information <knuteNOSPAMPLEASE@trinityproject.org>
        New Perl Beginners Site (Shlomi Fish)
    Re: newbie:substitution in a variable name <jurgenex@hotmail.com>
        print "Location: erratic ??????????? <dingdongy2k@hotmail.com>
    Re: print "Location: erratic ??????????? (David Efflandt)
    Re: Unlink Not Working On Windows Server (Tad McClellan)
    Re: Unlink Not Working On Windows Server (Tad McClellan)
    Re: Unlink Not Working On Windows Server (Philip Lees)
        user command with Net::FTP (Dr Trevor Hales)
    Re: user command with Net::FTP (Anno Siegel)
        visual perl and .net framwork <nntp@msn.com>
    Re: Why do I get an error More code <mail@annuna.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 16 Apr 2003 05:21:21 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: $name=<STDIN> problem
Message-Id: <slrnb9pq2h.s34.efflandt@typhoon.xnet.com>

On Tue, 15 Apr 2003 15:12:35 +0200, Jon Rogers <jon@rogers.tv> wrote:
> Hello
> 
> I'm experiencing problems with collecting info from the user:

Apparently getc() leaves a hanging enter in STDIN that you need to get rid 
of, so it works no better than simply using <STDIN> with chomp.  But using 
getc like this works:

#!/usr/bin/perl -w
print "press Y to identify yourself or N to move on ";
my $key=getc(STDIN);
<STDIN>;
if (lc($key) eq 'y') {
    print "what is your first name? ";
    my $firstname = <STDIN>;
    chomp($firstname);
    print "what is your second name? ";
    my $secondname = <STDIN>;
    chomp($secondname);
    print "$firstname $secondname\n";
}
# Note (my) $firstname and $secondname go out of scope here.

-- 
David Efflandt - All spam ignored  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, 16 Apr 2003 03:48:40 GMT
From: "Sam Jesse" <samj@austarmetro.com.au>
Subject: ActiveState vs. CPAN modules
Message-Id: <3e9cd297@news.comindico.com.au>

Hello
I am just learning perl and have 2 good book Element of Programming with
perl and Camel as well as Mastering regex and what a collection. love this
new lang.
I am not sure if I understand the module way of choosing and installing. I
have an ActivePerl installed under my W2K. I feel that CPAN has lots of
moudles to choose from vs. ActiveState may only have 150 or so. by my using
ActivePerl and PPM. Am I limited to the PPM version of the moudles and there
for will not be able to used modules provided on the CPAN site?

thanks
Sam




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

Date: Wed, 16 Apr 2003 04:15:43 GMT
From: "Knute Snortum" <knuteNOSPAMPLEASE@trinityproject.org>
Subject: Re: ActiveState vs. CPAN modules
Message-Id: <PN4na.23380$U34.5266@nwrddc02.gnilink.net>

Using PPM for ActivePerl is by far the easiest way, especially for a
neophyte.  You'd need a C compiler and a little luck to get them from source
to windows executable.

--
-- Knute Snortum
"Sure, I drink six 8-ounce glasses of water a day.  I just like my water
hot and filtered through ground coffee beans."


"Sam Jesse" <samj@austarmetro.com.au> wrote in message
news:3e9cd297@news.comindico.com.au...
> Hello
> I am just learning perl and have 2 good book Element of Programming with
> perl and Camel as well as Mastering regex and what a collection. love this
> new lang.
> I am not sure if I understand the module way of choosing and installing. I
> have an ActivePerl installed under my W2K. I feel that CPAN has lots of
> moudles to choose from vs. ActiveState may only have 150 or so. by my
using
> ActivePerl and PPM. Am I limited to the PPM version of the moudles and
there
> for will not be able to used modules provided on the CPAN site?
>
> thanks
> Sam
>
>




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

Date: Tue, 15 Apr 2003 20:13:42 -0500
From: Joe Creaney <mail@annuna.com>
Subject: another problem.
Message-Id: <3E9CAE46.2020002@annuna.com>

Can I access a 2 dim array in an object?
I keep getting syntax errors in statments like this:

$map->{map[$tx][$ty]} = ".";



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

Date: 16 Apr 2003 02:25:07 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: another problem.
Message-Id: <b7ieu3$mhq@dispatch.concentric.net>


"Joe Creaney" <mail@annuna.com> wrote in message
news:3E9CAE46.2020002@annuna.com...
> Can I access a 2 dim array in an object?
> I keep getting syntax errors in statments like this:
>
> $map->{map[$tx][$ty]} = ".";
>
1.  Of course, you're getting a syntax error; your syntax is wrong.  The map
function applies some operation to each element in a list and returns a list
of the transformed values.  Where are the in- and out-lists in your line of
code?

2.  While probably legal, to use the name of a Perl built-in function as the
name of a hash or object is a style guaranted to confuse self and others.




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

Date: 15 Apr 2003 20:59:36 -0700
From: tgfpits@yahoo.com (The Giant Flaming Penis In The Sky)
Subject: Re: Beginners qn about while loops/regex
Message-Id: <e441a9de.0304151959.56db0a8b@posting.google.com>

Brian McCauley <nobull@mail.com> wrote in message news:<u9znms9f3m.fsf@wcl-l.bham.ac.uk>...
> mctrewin@ihug.com.au (Matt T) writes:
> 
> > Subject: Beginners qn about while loops/regex
> 
> As a beginner you are not qualified to know if you have a beginner
> question or not.  Only a more experienced user answering your question
> can do that.  The more obscure special variables (such as @- (the one
> you seek)) are often considered a quite advanced topic.

He knows he's a beginner. He has a question. Put the two together and
he has a beginner's question, lack of apostrophe notwithstanding. He
didn't say "beginner-level difficulty question." If you must be
snotty, at least pay attention to what he wrote, not what you imagine
he wrote.
 
> Do not waste valuable space in your subject line with guesses about
> how advanced is the topic.

In spite of the fact that he did not do that.
 
> Your question has nothing really to do with while loops.  I has to do
> with the use of m//g in a scalar context.  However I suppose that's a
> subtlty you can be forgiven for not appreciating just yet. 

Oh, how magnanimous! You are truly a model of charity.

> Having removed all the obvious noise from the subject line you'd be
> left with pleanty of space to put real hard information about your
> question.  

Again, if you must deride others to bolster your self-esteem, you
might want to use a spell checker. Or am I nitpicking? Gosh, sorry.
 
> E.g.
>   Subject: Finding index of regex match in while(/(\w+)/g)
> 
> See?  With only a little thought you could have clearly have expressed
> your whole question in the subject line!

The OP couldn't have transgressed out of inexperience. It must have
been utter lack of brain activity. Got it.
 
> Good subject lines are vitally important in making Usenet a useful
> searchable resource.  As a beginner you can still do your bit to
> contribure to the community by puttin a lot of effort into composing
> your subject lines.

Yes, OP, you too may one day become a valuable contributor like the
above-quoted manly man. You will be fully equipped to be officious,
rude, and condescending. You can know the joy of shooting down
newbies, chastising them for being witless oafs as your chest swells
with pride. With your help, this community will continue to evolve
into a place where no slack is cut to beginners. If their first
questions fail to rise to the elite's standards of sophistication,
they will be publicly insulted by a supercilious uebergeek. You will
"contribure" to this brave new newsgroup.

> > I have a script that while-loops through each line of a file
> 
> This is in no way relevant to your question.  Figuring out what is and
> what is not part of your question is 80% of solving it.

More sage advice, again given with grace and charm.
 
> > then uses another while-loop to run through each word in the line
> > using a regex to match the words. I would like to know if it is
> > possible to get the index of the start of the word that I matched?
> 
> Yep, but only in recent Perl - the special variable @- is a recent addtion.

*gasp!* Help with Perl? No discourteous derision? Where's the sneering
tone?

> > I currently
> > have a solution which is incorrect. My code is roughly:
> > 
> > while (<INPUTFILE>) {
> >     $line = $_;
> >     while ($line =~ /(\w+)/g) {
> 
> Make up you mind.  Do you want this in $_ or not?  

Ah. There it is.

> Always declare all
> variables as lexically scoped in the smallest appripriate scope unless
> there is a reason to do otherwise.  Enabling strictures would help you
> to remember this.

Your masterpiece of self-importance is seriously diluted with this
stain of helpful advice. (I checked the FAQ - there's nothing there
about using mixed metaphors, so nyeah.)
 
[code snipped]

If you put some thought into what you're doing, you might one day
contribure to the effort to punish all beginners for their lack of
sophistication. You were doing so well, but you spoiled it by trying
to be helpful at the end. Maybe kicking your cat or stomping on some
chicks will get you back in "the zone."


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

Date: Wed, 16 Apr 2003 04:34:30 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Beginners qn about while loops/regex
Message-Id: <x765pfm562.fsf@mail.sysarch.com>


anyone who posts anonymous crap with no perl content at all is worse
than even a partly snide response which actually addresses the issue.

so when will your giant prickness be answering all the beginner stuff
with cogent, accurate, polite, timely posts? it is always the jerks like
you who flame those who do help and then they never take on the load.

you are a coward and that is worse than any asshole.

*plonk*

<even though it is an anon yahoo address>

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 15 Apr 2003 23:27:41 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Delete line based on the next.
Message-Id: <slrnb9p5bd.b23.abigail@alexandra.abigail.nl>

supportgeek (molivier@caregroup.harvard.edu) wrote on MMMDXIV September
MCMXCIII in <URL:news:da063e5d.0304151241.11dc7459@posting.google.com>:
||  Here's the latest situation I've gotten my self into...
||  
||  I need to delete a line based on the content on the next. Example of
||  the File:
||  
||  125 Jersey Road          104598213     #need to delete 
||  125 Jersey Road          14234523d     #need to keep
||  9832 Auto                              #need to keep
||  125 Jersey Road          345234235     #need to delete
||  125 Jersey Road          434234234     #need to keep
||  9832 Auto                              #need to keep
||  9832 Auto                              #need to keep
||  
||  As you can see I need to keep the lines where "9832 Auto" are below
||  "125 Jersey Road" lines. And get rid of the lines that do not have a
||  "9832" auto below them.
||  There are many cases where 9832 Auto is listed twice or thrice and I
||  need to keep all the lines.
||  
||  The type of file i need to produce is simply:
||  
||  125 Jersey Road          14234523d     
||  9832 Auto                              
||  
||  125 Jersey Road          434234234     
||  9832 Auto                              
||  9832 Auto              
||  
||  The numbers to the left are account numbers and will always be
||  different. the 125 Jersey Road and 9832 Auto will also remain the
||  same.


    $ perl -nle '($,,$_)=($_,$,); print if $, =~ /^9832/ || /^9832/;
                  END {print $,}' data_file


Abigail
-- 
perl -Mstrict -we '$_ = "goto F.print chop;\n=rekcaH lreP rehtona tsuJ";F1:eval'


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

Date: Tue, 15 Apr 2003 20:18:57 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Delete line based on the next.
Message-Id: <slrnb9pbs1.3j9.tadmc@magna.augustmail.com>

supportgeek <molivier@caregroup.harvard.edu> wrote:

> As you can see I need to keep the lines where "9832 Auto" are below
> "125 Jersey Road" lines.

> There are many cases where 9832 Auto is listed twice or thrice and I
> need to keep all the lines.


> Again, a shove in the right direction on this would be more than
> greatly appreciated. Thanks in advance.


 ------------------------------
#!/usr/bin/perl
use strict;
use warnings;

my @lines = <DATA>;
foreach ( 1 .. $#lines ) {
   if ( $lines[$_] =~ /^9832 Auto/ ) {
      print $lines[$_-1] unless $lines[$_-1] =~ /^9832 Auto/;
      print $lines[$_];
   }
}

__DATA__
125 Jersey Road          104598213     #need to delete
125 Jersey Road          14234523d     #need to keep
9832 Auto                              #need to keep
125 Jersey Road          345234235     #need to delete
125 Jersey Road          434234234     #need to keep
9832 Auto                              #need to keep
9832 Auto                              #need to keep
 ------------------------------


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


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

Date: Tue, 15 Apr 2003 23:16:05 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: GD::Graph-How to display string instead of values on axis?
Message-Id: <slrnb9p4ll.4f7.mgjv@verbruggen.comdyn.com.au>

On 15 Apr 2003 07:33:57 GMT,
	Sam Holden <sholden@flexal.cs.usyd.edu.au> wrote:
> On 15 Apr 2003 00:18:40 -0700,
> 	Valerie VANLERBERGHE <valerie_vanlerberghe@yahoo.fr> wrote:
>> Martien Verbruggen <mgjv@tradingpost.com.au> wrote in message news:<slrnb9mmmu.4ba.mgjv@verbruggen.comdyn.com.au>...
>>> On 14 Apr 2003 17:56:53 -0700,
>>> 	Valerie VANLERBERGHE <valerie_vanlerberghe@yahoo.fr> wrote:
>>> > Is there a way to display string instead of values on y-axis??
>>> > I mean, I'd like to display "OK" instead of 1, "Warnings" instead of
>>> > value 2, "KO"instead of value 3...on the axis
>>> 
>>> Something like (untested):
>>  I just tested it: it works...thanks a lot
> 
>>>  
>>> sub myformat
>>> {
>>>     my $val = shift;
>>>     my @values = qw/OK Warnings KO/;
>>>     return $values[$val - 1] || "ILLEGAL VALUE";
>>> }

> This is the first post in the thread that I actually saw, so sorry if I'm
> repeating something... Or if the context means the values are restricted
> somewhat.
> 
> Not checking the value of $val before indexing into the array will 
> cause 'KO' to be returned instead of 'ILLEGAL VALUE' when $val is 0. 
> And 'Warnings' when $val is -1, and 'OK' when $val is -2.
> 
> Due to perl's negative indexes access from the end (so -1 is the last
> element, -2 the second last, etc).
> 
> Safer to check if $val => 0  and $val <= $#value.

You're almost right. $val should be 1, 2 or 3, i.e. 
0 < $val <= @values. 

Something like (still untested):

sub myformat
{
    my $val = shift;
    my @values = qw/OK Warnings KO/;
    return "ILLEGAL VALUE" unless $val > 0 and $val <= @values;
    return $values[$val - 1];
}

Martien
-- 
                        | 
Martien Verbruggen      | Useful Statistic: 75% of the people make up
Trading Post Australia  | 3/4 of the population.
                        | 


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

Date: Wed, 16 Apr 2003 03:55:57 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: grep in array
Message-Id: <hv4na.13890$MB4.3494250@news4.srv.hcvlny.cv.net>


"Sandman" <mr@sandman.net> wrote in message
news:mr-BD9C35.16093115042003@news.fu-berlin.de...
> Hello! This is what I have:
>
> %people = (
>     "john", "John Andersson",
>     "will", "William Smith"
> );
>
> @names = ("Johnny", "David", "Willy boy", "Richard");
>


Names can be much more complicated than you first think.  Investigate
the module Lingua::EN::MatchNames
from CPAN.

Bill






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

Date: Wed, 16 Apr 2003 02:46:17 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to compare 2 data files?
Message-Id: <Zt3na.22630$Zx.17290@nwrddc01.gnilink.net>

mark sabatini wrote:
> I have 2 data files that i want to compare. They look like | separated

perldoc File::Compare

jue




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

Date: 15 Apr 2003 22:40:38 -0700
From: fumail@freeuk.com (qanda)
Subject: Re: keys function not printing keys in debugger
Message-Id: <62b4710f.0304152140.4f0ab3b3@posting.google.com>

"Bill Smith" <wksmith@optonline.net> wrote in message news:<y0Xma.7253$MB4.1660615@news4.srv.hcvlny.cv.net>...
> > If I then run in debug I don't understand why the keys function
> > does not print anything ...
> >   DB<2> keys %{$dtypes->{$type}{flds}}
> >
> >   DB<3>
> 
> The keys function never prints.
> try
> 
> print keys %{dtypes->{$type}{flds}}
> 
> By default, this will run all the keys together, but that may be ok for
> debug.
> 
> or use join
> 
> print join( "\n", keys %{$dtypes->{$type}{flds}}
> 
I completely missed that, it would also work with the print command
as in DB<n>p keys ...

Thanks Bill - you stopped me from going insane :)


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

Date: Wed, 16 Apr 2003 04:20:55 GMT
From: "Knute Snortum" <knuteNOSPAMPLEASE@trinityproject.org>
Subject: Re: need finding information
Message-Id: <HS4na.23413$U34.16459@nwrddc02.gnilink.net>

Do you mean, you have a text file, but what is the record separator?  x0a?
x0a0d?  x0d?

From what I've seen Perl seems to "do the right thing" most of the time, but
I haven't tested it.  I'm in an environment where Unix-like and DOS-like
text gets passed back and forth all the time and I've never run into an
end-of-script error.

--
-- Knute Snortum
"Sure, I drink six 8-ounce glasses of water a day.  I just like my water
hot and filtered through ground coffee beans."


"matt" <urzaserra@home.com> wrote in message
news:%5Yma.40$Gv5.39@fed1read02...
> I looked at perldoc.com but could not locate any infromation about
new-line
> charachters for different oses and such.  Would not having the right new
> line charachters cause premature end of script headers error??
>
>




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

Date: 15 Apr 2003 22:31:14 -0700
From: shlomif@vipe.technion.ac.il (Shlomi Fish)
Subject: New Perl Beginners Site
Message-Id: <deca99a9.0304152131.501b66b4@posting.google.com>

I have set up a new Perl Beginners' portal at:

http://perl-begin.berlios.de/

This site is not intended as a replacement for learn.perl.org, but
rather as a complement[1]. It covers various net resources more
closely, has a nicer look and feel (at least, IMO), and the source
code (in Web Meta Language) is online.

There will be more resources as time goes by. Feel free to contribute.
I will gladly make anyone a member of the project in BerliOS, and if
he contributes enough, an admin as well. I wish it to be a true
community web-site.

Regards,

	Shlomi Fish


[1] - I don't believe in concentration of effort. In PHP or VB for
instance, there are many portals with a lot of activity in them, and
it's not confusing for the users.


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

Date: Wed, 16 Apr 2003 02:51:10 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: newbie:substitution in a variable name
Message-Id: <yy3na.22640$Zx.1730@nwrddc01.gnilink.net>

Alexander Eisenhuth wrote:
> how can I access the value of these variables in a loop:
>
> my $B_01MASK = 0x01;
> my $B_02MASK = 0x02;
> my $B_03MASK = 0x04;
> my $B_04MASK = 0x08;
> my $B_05MASK = 0x10;
> my $B_06MASK = 0x20;
> my $B_07MASK = 0x40;
> my $B_08MASK = 0x80;
>
> my $i = 1;
> while ($i < 9) {
> print "name of var:B_0$i\MASK value:", ?? , "\n";
> $i ++;
> }
>

A better way to do that would be to use an array @B_MASK:
     my @B_MASK = (0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80);

Then the rest of the code becomes trivial

jue




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

Date: Tue, 15 Apr 2003 22:12:59 GMT
From: "Travis" <dingdongy2k@hotmail.com>
Subject: print "Location: erratic ???????????
Message-Id: <Lt%ma.24916$ey1.2242196@newsread1.prod.itd.earthlink.net>

I am having a problem using this:
_____________________

$linkto = "http://www.anyurl.com/";
   print "Location: $linkto\n\n";
______________________

When I have it in a script by itself it works fine.
When I try it in a script with other code does not do anything the first
time the script is run but if I refresh the page it works.

If it is at the beginning of the script before any conditions or headers etc
it works, with
the refresh, but if it is after any conditional statements it does not work
at all.

Any ideas.

Thanks
Travis




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

Date: Wed, 16 Apr 2003 05:34:12 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: print "Location: erratic ???????????
Message-Id: <slrnb9pqqk.s34.efflandt@typhoon.xnet.com>

On Tue, 15 Apr 2003 22:12:59 GMT, Travis <dingdongy2k@hotmail.com> wrote:
> I am having a problem using this:
> _____________________
> 
> $linkto = "http://www.anyurl.com/";
>    print "Location: $linkto\n\n";
> ______________________
> 
> If it is at the beginning of the script before any conditions or headers etc
> it works, with
> the refresh, but if it is after any conditional statements it does not work
> at all.

This is not a Perl specific problem.  Apparently based on your other
conditions, you may be printing something else before this.  Do NOT print
anything else to STDOUT if you are going to redirect, certainly not a
blank line or other headers terminated with double newline (first blank
line is end of headers).

-- 
David Efflandt - All spam ignored  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: Tue, 15 Apr 2003 19:31:09 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Unlink Not Working On Windows Server
Message-Id: <slrnb9p92d.3j9.tadmc@magna.augustmail.com>


[ Please do not top-post again. 
  Text rearranged into a sensible order.
]


George <geo@divergentweb.NO.SPAM.com> wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnb9op80.39k.tadmc@magna.augustmail.com...
>> George <geo@divergentweb.NO.SPAM.com> wrote:
>>
>> > rather I get an HTTP 500 error:
>>
>> > "Internal Server Error
>>
>> [snip]
>>
>> > More information about this error may be available in the server error
> log."
>>
>>
>> What messages did you see when you looked at the server error log?


> I do not know, though I have placed a call to the hosting company to find
> out. 


OK, then what happens when you run the program from the command
line rather than as a CGI program?


> I sort of hoped that even though Perl is supposed to transcend the
> platforms upon which it is installed there would be a common, well-known
> problem using Perl's unlink. 


Yes, there is such a well-known problem.

Permissions.


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


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

Date: Tue, 15 Apr 2003 19:33:36 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Unlink Not Working On Windows Server
Message-Id: <slrnb9p970.3j9.tadmc@magna.augustmail.com>

George <geo@divergentweb.NO.SPAM.com> wrote:

> the script does not delete files,


> unlink($delPath$filename);


If you want to know why the unlink() failed, then you should
ask why the unlink failed by testing its return value and
outputting the $! variable's contents:


   unlink($delPath$filename) or die "could not unlink:  $!";


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


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

Date: Wed, 16 Apr 2003 07:03:39 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Unlink Not Working On Windows Server
Message-Id: <3e9cff73.64636140@news.grnet.gr>

On Tue, 15 Apr 2003 14:13:48 -0400, "George"
<geo@divergentweb.NO.SPAM.com> wrote:

>use CGI;

It might be helpful to add this:

use CGI::Carp qw/fatalsToBrowser/;

>unlink($delPath$filename);

And, as Tad said:

unlink($delPath$filename)  or die "Can't delete $filename: $!;

Phil
-- 
Ignore coming events if you wish to send me e-mail


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

Date: Wed, 16 Apr 2003 02:41:40 GMT
From: t.hales@unimelb.edu.au (Dr Trevor Hales)
Subject: user command with Net::FTP
Message-Id: <3e9cc21c.85626187@news.unimelb.edu.au>

Dear  Perlers 
Please can advise me how I can do the following interaction using the
Net::FTP module within pel ?

> Please find attached an ftp session show how you can
> login again as a user...
>  > ftp <name.org.com>
> Connected to <name.org.com>
> 220 tigger FTP server (...) ready.
> Name (<name.org.com>:thales): anonymous
> 331 Guest login ok, send ident as password.
> Password:
> 230 Guest login ok, access restrictions apply.
> ftp> user
> (username) <enterusername>
> 331 Password required for <enterusername>
> Password:
> 230 User <enterusername> logged in.
> ftp> ls -tl
> 200 PORT command successful.
> .....<snip>..........
> 221 bytes received in 0.24 seconds (0.90 Kbytes/s)
> ftp>
> Any guidance / help you can provide re this issue


Thanking you in anticipation.
Regards
Trevor



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

Date: 16 Apr 2003 06:59:01 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: user command with Net::FTP
Message-Id: <b7iuvl$fd8$1@mamenchi.zrz.TU-Berlin.DE>

Dr Trevor Hales <t.hales@unimelb.edu.au> wrote in comp.lang.perl.misc:
> Dear  Perlers 
> Please can advise me how I can do the following interaction using the
> Net::FTP module within pel ?
> 
> > Please find attached an ftp session show how you can
> > login again as a user...
> >  > ftp <name.org.com>
> > Connected to <name.org.com>

[...]

What have you tried so far?

Anno


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

Date: Tue, 15 Apr 2003 16:58:45 -0700
From: "nntp" <nntp@msn.com>
Subject: visual perl and .net framwork
Message-Id: <FUedndKtXe0tAQGjXTWcqw@giganews.com>

Hi,
If I program in visual perl, does it mean I only need the .net framwork to
run my code?
So no more activestate perl on every machine?
Thanks




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

Date: Tue, 15 Apr 2003 20:14:39 -0500
From: Joe Creaney <mail@annuna.com>
Subject: Re: Why do I get an error More code
Message-Id: <3E9CAE7F.2040004@annuna.com>

I did find them now.

Martien Verbruggen wrote:
> On Mon, 14 Apr 2003 17:52:07 -0500,
> 	Joe Creaney <mail@annuna.com> wrote:
> 
>>
>>Joe Creaney wrote:
>>
>>>
>>>Uri Guttman wrote:
>>>
>>>
>>>>because you followed up your own post with no new content.
>>>>
>>>>uri
>>>>
>>>
>>>I added more code than my first post.  What else would be helpful.  It 
>>>is kind of a long program.
>>>
>>>
>>
>>Where should I look to find the error?
> 
> 
> [snip of essentially the same broken code posted before]
> 
> 
> Did you actually read the responses you got to earlier posts of this
> same code? You have left in the same errors that have already been
> corrected for you at least twice. Please, go back and find your
> earlier posts and replies to that, and read them.
> 
> Martien



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

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


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