[11604] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5204 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 23 02:07:22 1999

Date: Mon, 22 Mar 99 23:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 22 Mar 1999     Volume: 8 Number: 5204

Today's topics:
    Re: "small" problem (Ronald J Kimball)
        ANNOUNCE: Boston.pm Social Meeting, Thurs Mar 25 (Ronald J Kimball)
    Re: array question (Ronald J Kimball)
    Re: choping off whitespace (Steve Lamb)
    Re: choping off whitespace (Larry Rosler)
    Re: choping off whitespace <nessus@shell5.ba.best.com>
    Re: Direct memory access via Perl? (Tad McClellan)
    Re: FTP Recursive Directory Listing <m-rau@gmx.de>
    Re: Help Needed Please!!! (Ronald J Kimball)
        How to redirect in new window? <tbobek@vlnk.net>
    Re: looking for script... (Ronald J Kimball)
        Missing a module? melLA@west.net
        MS Access and Perl -- help! (Pete)
        Need username in Perl script (John Dilley)
    Re: Odd/Even (Ronald J Kimball)
        Q: Installations and use of my own XS modules <bouteille@dial.oleane.com>
    Re: regular expression with "*" (Ronald J Kimball)
    Re: remove HTML from a string on perl5.004_4 (Ronald J Kimball)
        retrieve the first hyperlink from an html file brz@hotmail.com
    Re: return codes in Win32 Perl <pmak@iname.com>
    Re: Sending to multiple recipients via Sendmail <mfoster@spots.ab.ca>
        STDOUT buffering <trevore@afb.net.au>
    Re: UNIX --> WinNT --> Excell Spreadsheet via OLE <madebeer@igc.apc.org>
    Re: UNIX --> WinNT --> Excell Spreadsheet via OLE <madebeer@igc.apc.org>
    Re: Want to learn Perl (Sam Holden)
    Re: Where to start with Perl <luke@fridge.chipcity.com.au>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 23 Mar 1999 01:18:40 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: "small" problem
Message-Id: <1dp3doy.dri7gzvbnm9iN@p57.block2.tc3.state.ma.tiac.com>

"Jim" <syt@email*@sp\am|@|spa/m@*.com> wrote:

> here's what I have now, I need to be able to put the file into different
> arrays according to $prodcat(at least that's what i think i need to do)
> 
> foreach $i (@datainfo)
> {
> ($prodcat, $prodname, $prodprice) = split(/\|/, $i);
> print "<h2>$prodcat $prodname $prodprice<br>\n";
> }


Here's one way to do it:

foreach $i (@datainfo) {
    ($prodcat, $prodname, $prodprice) = split(/\|/, $i);
    push, @{$products{$prodcat}}, [$prodname, $prodprice];
}


This creates a hash to anonymous arrays of anonymous arrays:

%products = (
  category1 => [
    [ product1, price1 ],
    [ product2, price2 ],
  ],
  category2 => [
    [ product3, price3 ],
    [ product4, price4 ],
  ],
);


Then you'd print out the products like this:

foreach $category (keys %products) {

    print "$category\n";

    foreach $prod_ref ($products{$category}) {
        print "  $prod_ref->[0]\t$prod_ref->[1]\n";
    }

    print "\n";

}


You'll want to read the documentation for perlref, perllol, and perldsc
to find out more about references and nested data structures.


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 23 Mar 1999 01:19:00 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: ANNOUNCE: Boston.pm Social Meeting, Thurs Mar 25
Message-Id: <1dp3hvu.1iawtx016wn2jvN@p57.block2.tc3.state.ma.tiac.com>

Boston.pm Social Meeting
7pm, Thursday, March 25
Elaine's house in Arlington


In addition to the usual socializing, there will be a brainstorming
session on ideas for the Boston Perl Mongers party at next month's
O'Reilly Perl Tutorials.

Feel free to bring food or drink to share.  (But don't feel obligated!)


E-mail for directions.


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
          "Let them wear hats!"


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

Date: Tue, 23 Mar 1999 01:18:43 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: array question
Message-Id: <1dp3emd.4sy9749aatd1N@p57.block2.tc3.state.ma.tiac.com>

David L. Cassell <cassell@mail.cor.epa.gov> wrote:

> > $file_extension =~ /\.(.*)$/is;

> One is that your first regex
> is greedy.  If your file is named my.cool.file.txt the regex
> will return 'cool.file.txt' instead of 'txt'.  Change the 
> (.*) to (.*?) .  The 's' on the end is probably not needed either.

And then realize that that will have no affect on the result, because

/\.(.*?)$/is;

will always match in the same way as /\.(.*)$/is.  They both match from
the first period to the end of the string.


/\.([^.]*)$/;


(The /i doesn't do much good either.)

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'


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

Date: 22 Mar 1999 20:03:47 +0800
From: morpheus@no-spam.calweb.com (Steve Lamb)
Subject: Re: choping off whitespace
Message-Id: <slrn7fe4l3.pvb.morpheus@teleute.rpglink.com>

On 23 Mar 1999 03:40:07 GMT, Damon61 <damon61@aol.com> wrote:
>Can someone please tell me how to chop off the leading and trailing
>whitespace of a string.  It seems so simple, but i'm having trouble.  Any
>help is greatly appreciated.

$string =~ s/^\s*//;
$string =~ s/\s*$//;

    Just a guess.

-- 
             Steve C. Lamb             | Opinions expressed by me are not my
    http://www.calweb.com/~morpheus    | employer's.  They hired me for my
             ICQ: 5107343              | skills and labor, not my opinions!
---------------------------------------+-------------------------------------


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

Date: Mon, 22 Mar 1999 20:18:07 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: choping off whitespace
Message-Id: <MPG.1160b5d778ee94149897a9@nntp.hpl.hp.com>

In article <slrn7fe4l3.pvb.morpheus@teleute.rpglink.com> on 22 Mar 1999 
20:03:47 +0800, Steve Lamb <morpheus@no-spam.calweb.com >says...
> On 23 Mar 1999 03:40:07 GMT, Damon61 <damon61@aol.com> wrote:
> >Can someone please tell me how to chop off the leading and trailing
> >whitespace of a string.  It seems so simple, but i'm having trouble.  Any
> >help is greatly appreciated.
> 
> $string =~ s/^\s*//;
> $string =~ s/\s*$//;
> 
>     Just a guess.

That works, and is almost right.  But why answer with a guess?  For such 
a Frequently Asked Question, the definitive answer in in the Perl FAQ.  

perlfaq4:  "How do I strip blank space from the beginning/end of a 
string?"

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com


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

Date: 23 Mar 1999 05:25:18 GMT
From: "J. David Eisenberg" <nessus@shell5.ba.best.com>
Subject: Re: choping off whitespace
Message-Id: <36f725be$0$204@nntp1.ba.best.com>

Larry Rosler <lr@hpl.hp.com> wrote:
: In article <slrn7fe4l3.pvb.morpheus@teleute.rpglink.com> on 22 Mar 1999 
: 20:03:47 +0800, Steve Lamb <morpheus@no-spam.calweb.com >says...
:> On 23 Mar 1999 03:40:07 GMT, Damon61 <damon61@aol.com> wrote:
:> >Can someone please tell me how to chop off the leading and trailing
:> >whitespace of a string.  It seems so simple, but i'm having trouble.  Any
:> >help is greatly appreciated.
:> 
:> $string =~ s/^\s*//;
:> $string =~ s/\s*$//;
:> 
:>     Just a guess.

: That works, and is almost right.  But why answer with a guess?  For such 
: a Frequently Asked Question, the definitive answer in in the Perl FAQ.  
Interesting comment: "That works, and is almost right."  If it
works, then it _is_ right. It may not be the most efficient way
to do it, but it's straightforward to read and understand. I had
been under the impression that there's usually more than one
way to do something in perl. 

However, I stand corrected, and shall seek out the perl faq
so that I may find out the one way, the only way,
the "right" way to do it. <grin>

: -- 
: (Just Another Larry) Rosler
: Hewlett-Packard Company
: http://www.hpl.hp.com/personl/Larry_Rosler/
: lr@hpl.hp.com

-- 
J. David Eisenberg    http://www.best.com/~nessus


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

Date: Mon, 22 Mar 1999 16:55:58 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Direct memory access via Perl?
Message-Id: <e9e6d7.k01.ln@magna.metronet.com>

George Kuetemeyer (george.kuetemeyer@mail.tju.edu) wrote:


: Jeff J wrote:

: > $runthis="echo d F000:FFB6 \n q \n | debug.exe";

: > $temp=qx/$runthis/;
          ^^
          ^^
          ^^
: >
: > then I parse $temp to get the info returned by the system call to debug.
: >
: > This works, but for some reason, my logon script won't finish. It appears to
: > run the very last line of code, and everything is successful, but the script
: > window does not close, as if the Perl program is still running.

: Try using backticks instead of double quotes:

:           $runthis = `echo d F000:FFB6 \n q \n | debug.exe`;



   qx// *is* backticks. 

   Your suggestion isn't going to change anything...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 22 Mar 1999 01:23:49 GMT
From: "Michael Rau" <m-rau@gmx.de>
Subject: Re: FTP Recursive Directory Listing
Message-Id: <7d4635$me8$1@surz18.HRZ.Uni-Marburg.DE>

Jonathan Stowe schrieb in Nachricht
<7d3dcn$6rl$1@gellyfish.btinternet.com>...
>On Sun, 21 Mar 1999 16:41:05 GMT "Kevin S (xS)" wrote:
>> I take it alt.perl is frowned upon here. Doesn't matter really. No one
every
>> responds there.
>>
>
>Yep,  All I'm concerned about is getting the crap response back into this
>group.  There is no reason for an 'alt.perl' excpet for people who would
>rather not be told to read the documentation ...
>
>> Also do you have any advice on how to determine if an item is a dir or a
>> file. When I do a $ftp->dir it gives me the following
>>
>> dr-xr-xr-x 3 0 1 512 Mar 30 1994 usr
>>
>> I know I can just split the string and go from there but a lot cpu usage
>> there especially if I did it for more than one ftp per session. Any know
any
>> other ideas?
>>
>
>No that is about the only option open to you - I would split the returned
>rows and if the first field begins with 'd' push the last field into an
array
>(prepending the PWD ) and then cd to each directory thus discovered in
turn.


I dit it this way:

use Net::Ftp;

$ftp = Net::FTP->new($site{$host}->{HOST}, Timeout=>$site{$host}->{TIMEOUT})
or die "Can't connect to $site{$host}->{HOST}";
$ftp->login($site{$host}->{USER}, $site{$host}->{PWD},
$site{$host}->{ACCOUNT}) or die "Login failed";

@files = &GetRemoteDir ($site{$host}->{REMOTEDIR}, "");

sub GetRemoteDir {
 my ($dir, $pathname) = @_;
 local (@files, @result);

 print "<DIR> $pathname\n";
 $ftp->cwd($dir) or die "Error CWD $dir";

 @files = $ftp->dir;
 foreach (@files) {

  ($attrib, $nr, $ident, $user, $size, $date, $name) = $_ =~ /([^\ ]+)\
+(\d+) +([^\ ]+)\ +([^\ ]+)\ +(\d+) +(...\ .{8})\ +(.+)/i;

  if ($attrib =~ /^drw.*/i) {
   push (@result, GetRemoteDir($name, "$pathname/$name"));
  }
  elsif  ($attrib =~ /^.rw/i) {
   push (@result, "$pathname/$name;$size");
  }
 }
 $ftp->cwd("..");
 return @result;
}

Regards mr.






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

Date: Tue, 23 Mar 1999 01:18:49 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Help Needed Please!!!
Message-Id: <1dp3fgm.ii0kucc3qrxiN@p57.block2.tc3.state.ma.tiac.com>

Mark P. <mag@imchat.com> wrote:

>   Sorry, I guess you're right. I just always saw single lines
> and assumed. Still learning. Doing pretty good with absolutely no
> programming experience also.

Don't worry, even after gaining programming experience, you'll still
make silly mistakes now and then.

I know I still do!

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 22 Mar 1999 22:10:48 -0800
From: "Tracey Bobek" <tbobek@vlnk.net>
Subject: How to redirect in new window?
Message-Id: <7d7b17$bn7$1@utah.laird.net>

I know how to create a list box the redirects the user to another website
within the same browser window.  How do you redirect the user to another
website in a new window?  (Like the "TARGET=_blank" tag in HTML?)

I think the answer is simple, but I'm having trouble.

Thanks for the help,

Chris




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

Date: Tue, 23 Mar 1999 01:18:51 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: looking for script...
Message-Id: <1dp3gew.1hq5s23110vx6jN@p57.block2.tc3.state.ma.tiac.com>

Jay Glascoe <jglascoe@giss.nasa.gov> wrote:

> perl -0777 -ne '
>     BEGIN { $id = shift }
>     m/(:?^|\n)$id: (.*?)(:?\n\d+:|$)/s and print $2;
> ' 32784 input_file > output_file

Are those optional colons, or non-grouping parentheses?


Also, you can simplify that a bit by using /m.


perl -0777 -ne '
    BEGIN { $id = shift @ARGV }
    m/^$id: (.*?)(?:^\d+:|\Z)/sm and print $1;
' 32784 input_file


-- 
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
      perl -s -e'print sort grep { /\s/ } keys %main::
            ' -- -is -' Just' -' another ' -'Perl ' -'hacker 
' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]


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

Date: Tue, 23 Mar 1999 04:59:23 GMT
From: melLA@west.net
Subject: Missing a module?
Message-Id: <36f71eb3.14698435@news.west.net>

While trying to run Makefile.PL on module DBI, at the command line I
typed:

perl5.00502 -w Makefile.PL prefix=/home/user/.../.../cgi-bin/perl/lib

and I got back:

Can't load module IO, dynamic loading not available in this perl.
  (You may need to build a new perl executable which either supports
  dynamic loading or has the IO module statically linked into it.)

Am I missing a module? I would think the latest Perl would feature
dynamic loading if it were needed.

Thanks,
Milt

(remove all CAPS from my e-addr)

x-no-archive: yes




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

Date: 23 Mar 1999 06:52:17 GMT
From: psalzman@landau.ucdavis.edu (Pete)
Subject: MS Access and Perl -- help!
Message-Id: <7d7dn1$ce7$1@mark.ucdavis.edu>

Dear all, 

I'm having trouble understanding all the steps necessary to get perl to
'talk' with a MS Access database.   Here's what I've done so far:

1- I installed DBI ver 1.06
2- At this point, I tried installing DBD-ODBC-0.20
3- When I ran perl Makefile.pl it told me that I need an ODBC Driver
     Manager.

I'm confused because I thought that DBD-ODBC *was* the driver.  If it's
not, what exactly is it?  Anyhow, it said:

   If you do not have an ODBC Driver Manager you can try building
   the free iODBC Driver Manager in the iodbcsrc directory.

OK.  so i cd to iodbcsrc and follow the instructions to the letter.  This 
is what I get:

# ./build linux-elf
autoconfig linux-elf
make
gcc -O -fPIC -ansi -I. -DDLDAPI_SVR4_DLFCN  -DVERSION=\"2.12.0\"    -c
dlf.c -o dlf.o
In file included from dlf.c:16:
dlf.h:4: windows.h: No such file or directory

I'm having a rough time here.  Can some kind soul please help me get this
running?

Much thanks!
Peter

--
---------------------------------------------------------------
http://landau.ucdavis.edu/psalzman
psalzman@landau.ucdavis.edu
One world, one web, one program. -- Microsoft Ad Campaign
Ein Volk, ein Reich, ein Fuhrer. -- Nazi Ad Campaign
Prevent world domination, Install Linux today!
---------------------------------------------------------------
  The best way to accelerate a win95 system is at 9.81 m/s^2



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

Date: Tue, 23 Mar 1999 06:14:29 GMT
From: john@deletethisdilley.com (John Dilley)
Subject: Need username in Perl script
Message-Id: <36f830d7.90195566@news.jps.net>

Hoping this is possible, I'm sure I'm not the first but a scan FAQs and Deja
News did not help, must not know the secret word...

I have a PERL script inside a private directory protected with a .htaccess
file. I would like the script to use the login name of the user accessing that
directory. A test sample of all $env didn't show anything of real use. One web
page I found mentioned REMOTE_USER, but this does not appear in my list. Is
there a way to get the htaccess login name from within my script?

I hate to ask, but could you please reply in email as well as to the group? My
ISP's news server is going down as often as $PresidentialIntern and missing
major chunks of mail....

	JohnD  (John at dilley daught com)


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

Date: Tue, 23 Mar 1999 01:18:52 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Odd/Even
Message-Id: <1dp3gkr.na65rqq8sztsN@p57.block2.tc3.state.ma.tiac.com>

Gabriel Richards <grichard@uci.edu> wrote:

> if ($counter = [an odd number]) {do x}

if ($counter & 1) {do x}

Because an odd number has the 1's bit set.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        perl -le 'print "Just another \u$^X hacker"'


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

Date: 23 Mar 1999 06:31:04 +0100
From: Olivier Bouteille <bouteille@dial.oleane.com>
Subject: Q: Installations and use of my own XS modules
Message-Id: <m34snc7ox3.fsf@localhost.oleane.com>


HI !

I have a problem installing and using my XS modules sinci I use
perl5.005_02.

Suppose I have written a Foo module and I want to install it in /toto.

To install it, I used (with perl5.004_04) to execute

make install PREFIX=/toto

When I do that, with perl5.005_02 the dynamic lib is installed in

/toto/lib/perl5/site_perl/5.005/i586-linux/auto/Foo/Foo.so

So that, to use it, I have to 

use lib '/toto/lib/perl5/site_perl/5.005/'; 

to use my Foo module.

Is that normal, that the text of all my script will depend on the
version of perl I use ?

Thanx for any reponse !

-- 
 Olivier (bouteille@dial.oleane.com) 
	
"This may seem a bit weird, but that's okay, because it is weird !"
(Larry Wall)


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

Date: Tue, 23 Mar 1999 01:18:53 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: regular expression with "*"
Message-Id: <1dp3gui.1fqn4v61ljjgxtN@p57.block2.tc3.state.ma.tiac.com>

[posted and mailed]

Zhiliang Hu <zlhu@iastate.edu> wrote:

> The following didn't work when more combinations were considered:
> 
> 1.      if ($FORM{terms} eq "\w*\*\w*")                   { (some
> trapping codes) } else { (some task codes) }
> 2.      if ($FORM{terms} eq "\w\s*\*\w\s*")            { (some trapping
> codes) } else { (some task codes) }
> 3.      if ($FORM{terms} eq "[a-zA-Z+]*\*[a-zA-Z+]*") { (some trapping
> codes) } else { (some task codes) }
> 4.      if ($FORM{terms} eq "[a-zA-Z+]*\*[a-zA-Z+]*") { (some trapping
> codes) } else { (some task codes) }
> 5.      if ($FORM{terms} eq ".*\*.*")                          { (some
> trapping codes) } else { (some task codes) }

You're obviously trying to use regular expressions here, but you seem to
be rather confused about the syntax.


eq is for comparing literal strings.   $str eq "\w*\*\w*" is true if the
value of $str is exactly the string 'w**w*'.


You perform regular expression matches with the m// operator.  Like
this:  m/\w*\*\w*/.  That will match if the value of the target variable
contains zero or more word characters, then an asterisk, then zero or
more word characters.


The target variable in that last example is $_ - that's simply the
default variable.  You specify a different target variable with the =~
operator, like this:  $str =~ m/\w*\*\w*/.  That will match in the same
way, but for $str rather than $_.


So, the code you want to use is:

if ($FORM{terms} =~ m/\*/) {
  (some trapping codes)
} else {
  (some task codes)
}


You can find out more about using regular expressions by reading the
perlre and perlop documentation.


Hope that helps!


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        perl -le 'print "Just another \u$^X hacker"'


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

Date: Tue, 23 Mar 1999 01:18:58 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: remove HTML from a string on perl5.004_4
Message-Id: <1dp3h4h.1w09g5k7l3x3aN@p57.block2.tc3.state.ma.tiac.com>

yang shen <ys74@cornell.edu> wrote:

>   /<(?:[^>'"]*|(['"]).*?\1)*>/: regexp *+ operand could be empty at
               ^

Try changing that to a +.  Perl complains because the outer *'s
subexpression can be empty, and {empty string}* could get you into an
infinite loop if the regex engine isn't careful, because it could repeat
the empty string indefinitely.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 23 Mar 1999 04:41:56 GMT
From: brz@hotmail.com
Subject: retrieve the first hyperlink from an html file
Message-Id: <7d762i$135$1@nnrp1.dejanews.com>

Can someone show me how to retrieve the first hyperlink in an html file?

Thanks

brz@hotmail.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 23 Mar 1999 13:42:21 +0800
From: Phil Mak <pmak@iname.com>
Subject: Re: return codes in Win32 Perl
Message-Id: <36F729BD.3825C708@iname.com>

J|rgen,

I used both system ("del $filename");  and `del $filename`.  Neither of them
work though.  When I use the system command, I get a return code of '256'.
When I use the back-quote characters (i.e. `) I get a return code of '65280'.
Any ideas?

Phil

J|rgen Ibelgaufts wrote:

> Phil,
>
> what do you delete the files with? The Perl lines
>
> system ("del $filename")
>
> or
>
> unlink $filename
>
> should always do what you want.
>
> Juergen Ibelgaufts
>
> ----------------------------------------------------------------------
>
> Phil Mak schrieb:
> >
> > Hi,
> >
> > I've set up a Perl program to delete certain files from a directory
> > running under Windows NT.  For some reason, it is not doing it.  When I
> > check the $? variable to find out the return code, it gives me the value
> > '65280'.  Does anyone know what this means?  Or can somebody direct me
> > to a web page that would contain a list of all the return codes and
> > their meanings?  Just need someone to point me in the right direction.
> >
> > Thanks,
> > Phil



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

Date: Mon, 22 Mar 1999 22:53:48 -0700
From: Martin Foster <mfoster@spots.ab.ca>
Subject: Re: Sending to multiple recipients via Sendmail
Message-Id: <36F72C6C.51F22D14@spots.ab.ca>

Jonathan Stowe wrote:
> 
> Except of course Glen explicitly mentioned that he was using
> 'sendmail'.  As has been discussed to death in comp.lang.perl.misc it
> is in almost all cases preferable to use some reliable MTA such as
> sendmail *where that is available* to deal with this stuff - I wont
> rehearse the arguments here but a quick search of DejaNews will get a
> broad spectrum of the various views around this.

I will have to check into this, as I always believed that direct SMTP
communication would be what is needed.  Though my eventual goal is to
make a web based mailer, with functions aimed at security.  But that is
not planned for a while yet (only working on the smaller needed
components).  As for recommending SMTP, even though I knew he was using
Sendmail...  It was quite simple, I was offering a possible alternative,
nothing else.

> >
> >P-S.  You can interface with SMTP directly by telneting into port 25
> >of the server you deal with.  Which in most cases will be localhost.
> >
> 
> If using Perl and you need to do this then Net::SMTP is probably a
> better solution - and I dont think that it is a safe assumption that
> in all case the SMTP server will be on localhost - especially if one
> isnt runnig unix.
> 

I just now discovered the existence of Net::SMTP, I definitely need to
get more documentation then the two books I have.   The reason I sated
Localhost, was simple, Glen had mentioned he had access to sendmail, so
I assumed (though I agree it should of not been assumed) that he had
direct access trough telnet et cetera.

					Martin Foster
					mfoster@spots.ab.ca


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

Date: Tue, 23 Mar 1999 15:11:33 +1000
From: Trevor <trevore@afb.net.au>
Subject: STDOUT buffering
Message-Id: <36F72285.7AA57C6F@afb.net.au>

Hi,

I am using the following code fragment to run an external program:

    open PROC, "program.exe|";
    while (<PROC>)
    {
        print($_);
    }

what I'm seeing is that STDOUT from program.exe is coming out
bunched. So it would appear that perl is buffering STDOUT.
How can I tell perl not to do this?

I'm using perl 5.004 under Windowns NT.

Thanks,
Trevor.

-- 
Trevor Elbourne - Director
 AFB Engineering Pty Ltd
 
 +61-2-9571-8662 (phone)
 +61-2-9571-8663 (fax)
mailto:trevore@afb.net.au


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

Date: Mon, 22 Mar 1999 16:46:34 -0800 (PST)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: UNIX --> WinNT --> Excell Spreadsheet via OLE
Message-Id: <APC&1'0'50775d91'ba2@igc.apc.org>

$> perl5 -MCPAN -eshell

cpan> i /Excel/

Module id = Spreadsheet::Excel
    DESCRIPTION  Interface to Excel spreadsheets
    CPAN_USERID  RRAWLINGS (Rachel McGregor Rawlings <rachel@wuxtry.com>)
    DSLI_STATUS  i    (idea,unknown,unknown,unknown)
    INST_FILE    (not installed)




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

Date: Mon, 22 Mar 1999 17:05:58 -0800 (PST)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: UNIX --> WinNT --> Excell Spreadsheet via OLE
Message-Id: <APC&1'0'50775d92'17a@igc.apc.org>

I remember browsing a CPAN entry that 
had a Perl daemon running on a Windows machine, listening on a port.  

A client (usually on unix) would send a plain text file to the server.
The server would turn it into excel via OLE or something, 
and send it back to the client on another port.

OR, 

the client would send an excel or MSWord file to the server, and server
would send back an ascii file.  I think the readme said it could do
simple tables, but not .xls files with embedded charts or other fancy
stuff. 

I can't find it now.

-Michael





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

Date: 23 Mar 1999 04:54:00 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Want to learn Perl
Message-Id: <slrn7fe7j8.6eo.sholden@pgrad.cs.usyd.edu.au>

On 23 Mar 1999 03:29:21 GMT, ICG's <postmaster@uu.net> wrote:
>
>At first, I hated the concept of Java.  But it's usefull for neat little 
>tricks that are impossible in Perl.  Perl on the other hand, can do things 
>that Java can't do.  (such as fingering 3 separate network access servers, 
>doing a selective port scan across 15 IPs, manipulating the data and telling 
>you the state of all the critical systems and services in an ISP, and the 
>number of users <with logon names>)

That is possible in Java, it might need a little more code but it is possible.

-- 
Sam

Simple rule: include files should never include include files.
	--Rob Pike


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

Date: Tue, 23 Mar 1999 16:21:03 +1030
From: Luke <luke@fridge.chipcity.com.au>
Subject: Re: Where to start with Perl
Message-Id: <Pine.LNX.3.96.990323161300.650B-200000@fridge.chipcity.com.au>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--936050965-1822255118-922168263=:650
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hi,

I have a problem, maybe someone can help me with.
I have attached a program.
I have explained my problem in the comments,
Can anyone explain?

Luke

 _--_|\     Luke Vanderfluit        Email: luke@chipcity.com.au
/      *    49 Storey Avenue        
\_.--._/    Aldinga Beach SA 5173   
      v     Australia               

--936050965-1822255118-922168263=:650
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=chp7test1
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.990323162103.650C@fridge.chipcity.com.au>
Content-Description: the program

IyEvdXNyL2Jpbi9wZXJsDQojIFRoaXMgcHJvZ3JhbSBpcyB0byB0ZXN0IG91
dCBzb21lIHRoaW5ncw0KIyBUbyBpbGx1c3RyYXRlIG15IHByb2JsZW0NCiMg
VGhlICJ3b3JrIiBmaWxlIGNvdWxkIGNvbnNpc3Qgb2YgdGhlIGZvbGxvd2lu
ZyBsaW5lczoNCiMjIyMjIyMjIyMjIyMjIyMjIyMNCiMgdGFrZSBwaG90b3MN
CiMgcGhvdG9zDQojIyMjIyMjIyMjIyMjIyMjIyMjDQoNCm9wZW4oV09SSywg
IndvcmsiKTsNCg0Kd2hpbGUoPFdPUks+KSB7DQoNCiMgaWYgSSB1c2UgdGhp
cyBsaW5lIGl0IGRvZXNuJ3QgZ2l2ZSBtZSBhbnkgcmVzdWx0Og0KCWlmKC8o
cGgpXGJ8XGJcMS8pIHsNCiMgaWYgSSB1c2UgdGhpcyBsaW5lIGl0IGRvZXM6
DQojCWlmKC9waFxifFxicGgvMSkgew0KCQlzLyAvWFhYWFhYL2c7DQoJCXBy
aW50ICIkXyI7DQoJfQ0KfQ0KY2xvc2UoV09SSyk7DQo=
--936050965-1822255118-922168263=:650--


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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