[12524] in Perl-Users-Digest
Perl-Users Digest, Issue: 6124 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 25 07:07:18 1999
Date: Fri, 25 Jun 99 04:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 25 Jun 1999 Volume: 8 Number: 6124
Today's topics:
Beginners Question: How to jump in and out subdirectori <p.fornerod@tn.utwente.nl>
Re: Beginners Question: How to jump in and out subdirec <hvermeulen@correctnl.com>
Re: bulk email using SendMail <anfi@bigfoot.com>
cl.exe (Andrea Busia)
Re: cl.exe <gellyfish@gellyfish.com>
Re: cl.exe <sb@sdm.de>
Re: FAQ 2.11: Perl Books (Eric Bohlman)
format the output of scalar date/time <nedred@my-deja.com>
Internet Startup Company looking for programmers, desig <Internet_Recruit@yahoo.com>
Need some help on Sockets BSDI 4.0 (ZepHead)
Re: Perl in Win32 <streaking_pyro@my-deja.com>
PerlScript & Session object <segers@neroc.nl>
Re: PerlScript & Session object <matt.sergeant@ericsson.com>
Re: problems with chmod function <ronald_f@my-deja.com>
Reading Excel Sheets (baga@gmx.net)
Re: Regex question (i think) <hvermeulen@correctnl.com>
Using Tk or Win32::GUI in Win32 <streaking_pyro@my-deja.com>
Re: validating a regexp from a CGI form (Bart Lateur)
Re: What in my concatenated string? (Bart Lateur)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 25 Jun 1999 13:23:54 +0200
From: Pollus Fornerod <p.fornerod@tn.utwente.nl>
Subject: Beginners Question: How to jump in and out subdirectories?
Message-Id: <377366CA.D3F9CF78@tn.utwente.nl>
Hi.
I made a perl script (thumbnail.pr)that checks the contence of the
directory it's in, and if it finds a jpeg picture it creates a thumbnail
picture (using the shell command `convert bla bla`), and at the end it
makes a HTML thumbnail page. That script runs fine.
Now I have to manually dive into all my subdirectories to run the
script. So I want to make an other script that dives into my subdirs to
check for jpegs. Been there, done that. Textbook code.
But now: If I find the jpegs in a subdirectory and I have the name of
that subdirectory in a variable $subdir I want to jump into that
directory using the shell's `cd "$subdir"` to run my old thumbnail.pr
script there nothing happens! It seems I cannot change directories from
within the script using the shell command `cd`.
Am I trying to do something extremely stupid here?
Any hints how to get it done, jumping to a subdirectory?
Regards, Pollus
p.fornerod@tn.utwente.nl
------------------------------
Date: Fri, 25 Jun 1999 12:32:56 +0200
From: Henry Vermeulen <hvermeulen@correctnl.com>
Subject: Re: Beginners Question: How to jump in and out subdirectories?
Message-Id: <37735AD8.CB859730@correctnl.com>
Pollus Fornerod wrote:
> But now: If I find the jpegs in a subdirectory and I have the name of
> that subdirectory in a variable $subdir I want to jump into that
> directory using the shell's `cd "$subdir"` to run my old thumbnail.pr
> script there nothing happens! It seems I cannot change directories from
> within the script using the shell command `cd`.
>
> Use chdir instead of cd.
See perlfunc
Henry
------------------------------
Date: Fri, 25 Jun 1999 10:34:41 +0200
From: Andrzej Filip <anfi@bigfoot.com>
Subject: Re: bulk email using SendMail
Message-Id: <37733F21.47BED558@bigfoot.com>
Dani Koesterich wrote:
> I revised a script of mine, and now it sends out all of the emails in
> the email address database, however after it is done it gives me a
> "Cannot find server" error and does not display the Success message.
> My script is below, and I would greatly appreciate it if someone
> could help me out. Thank You.
> [..]
There is another way:
Create files directly in sendmail queue (two files per message).
You should use non default directory (not the one used by sendmail
daemon) and when all files are generated start special sendmail
process to deliver email.
/usr/lib/sendmail -q -oQyour_queue_path -OQueueSortOrder=host
Otherwise you invoke special sendmail process to generate the
queue files (it makes difference when you send thousands messages)
--
Andrzej (Andrew) A. Filip fax: +1(801)327-6278
mailto:anfi@bigfoot.com http://www.bigfoot.com/~anfi
Postings: http://www.deja.com/profile.xp?author=Andrzej%20Filip&ST=PS
------------------------------
Date: Fri, 25 Jun 1999 09:04:10 GMT
From: busia@tiscalinet.it (Andrea Busia)
Subject: cl.exe
Message-Id: <377344d3.499439@news.tiscalinet.it>
whem I try to install the mysql module on win98 using nmake it return
me the error:
Fatal error U081: 'cl.exe': program not found.
What is cl.exe? Where can I find it?
I have:
Perl 5.00502
Gnuwin C++ b18
Nmake 1.5
Thanks
Andrea Busia
------------------------------
Date: 25 Jun 1999 10:19:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: cl.exe
Message-Id: <377349b2@newsread3.dircon.co.uk>
Andrea Busia <busia@tiscalinet.it> wrote:
> whem I try to install the mysql module on win98 using nmake it return
> me the error:
>
> Fatal error U081: 'cl.exe': program not found.
>
> What is cl.exe? Where can I find it?
cl.exe is the microsoft compiler ...
You wont have it unless you have purchased Visual C++.
>
> I have:
>
> Perl 5.00502
> Gnuwin C++ b18
> Nmake 1.5
>
You probably dont want to be using nmake if you are using gcc - use the gnu
make instead.
Oh BTW what was the Perl question ?
/J\
--
"I came on the train but I think I managed to pass it off as an asthma
attack" - Jenny Eclair
------------------------------
Date: 25 Jun 1999 10:28:23 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: cl.exe
Message-Id: <7kvlk7$g72$1@solti3.sdm.de>
In article <377344d3.499439@news.tiscalinet.it>,
Andrea Busia <busia@tiscalinet.it> wrote:
> whem I try to install the mysql module on win98 using nmake it return
> me the error:
> Fatal error U081: 'cl.exe': program not found.
> What is cl.exe? Where can I find it?
Microsoft Visual C++ compiler.
> I have:
> Perl 5.00502
> Gnuwin C++ b18
> Nmake 1.5
Your Perl configuration does not reflect your system.
Get your configuration right! (See ...\perl\5.00503\lib\MSWin32-x86\Config.pm)
And install the 4NT shell or get a copy of command.com from a Win NT system,
because the Win98 shell is too stupid for building Perl modules (you will get
errors if you don't).
Hope this helps.
Yours,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/
http://www.engelschall.com/u/sb/download/
http://www.perl.com/CPAN/authors/id/STBEY/
http://www.oreilly.de/catalog/perlmodger/bnp/
------------------------------
Date: 25 Jun 1999 08:35:28 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: FAQ 2.11: Perl Books
Message-Id: <7kvf0g$kgp@dfw-ixnews3.ix.netcom.com>
Tom Christiansen (perlfaq-suggestions@perl.com) wrote:
: Special Topics
: *Mastering Regular Expressions
: by Jeffrey Friedl
:
: How to Set up and Maintain a World Wide Web Site [2nd edition]
: by Lincoln Stein
Lincoln's book on using CGI.pm should probably be added here.
------------------------------
Date: Fri, 25 Jun 1999 08:25:52 GMT
From: Nedret <nedred@my-deja.com>
Subject: format the output of scalar date/time
Message-Id: <7kveea$uoa$1@nnrp1.deja.com>
Hi, I am newby. Maybe the question is stupid though:
I read date value from a database to a scalar and when a print it the
result is like 1999-06-25 00:00:00. The same happens when I print scalar
storing time. The result is 1800-12-31 14:23:40. How can I print the
date and the time in the format I like.
--
Nedret
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 25 Jun 1999 02:42:42 -0700
From: "Internet Recruit" <Internet_Recruit@yahoo.com>
Subject: Internet Startup Company looking for programmers, designers and administrators
Message-Id: <7kvj8c$vu$1@nntp9.atl.mindspring.net>
We are looking for people to help us launch and maintain in-house servers
for new internet startup company located in Los Angeles, CA. Anyone has any
experience on one the following areas should apply:
**Yes, we do run Apache servers on Linux RedHat**
1. Apache server setup and administration
2. DataBase Apps (SQL, Oracle8...)
3. Unix/Linux OS CGI scripting
4. Perl CGI scripting and programming
5. Graphics (Photoshop) design and preparation
6. HTML (the old way) and object based webdesign softwares like (NetObjects
Fusion)
Freelance or contract based. Salary plus stock options available for
qualified candidate. Please send your resume and sample site (if any) to
this email.
Thank you,
David Parks
------------------------------
Date: Fri, 25 Jun 1999 08:25:31 GMT
From: groovyt@erols.com (ZepHead)
Subject: Need some help on Sockets BSDI 4.0
Message-Id: <groovyt-2506990438140001@cn226598-b.wall1.pa.home.com>
Our UPS server script was working fine until our host upgraded their OS
now is doesn't work and appears to be a BSDI 4.0 socket problem.
Our error code returns a Connect Failed
I was thinking of doing this
Old code line:
$sockaddr = "S n a4 x8";
New code line:
$sockaddr = "x C n a4 x8";
What are your thoughts and comments?
Thanks
Russ
#------------------------------------------------------------
# function: UPSPrice
#------------------------------------------------------------
sub UPSPrice
{
local($upsAction,$upsProduct,$OriginPostalCode,$DestZipCode,$PackageWeight)=@_;
$AF_INET = 2;
$SOCK_STREAM = 1;
$sockaddr = "S n a4 x8";
$port = 80;
$them = "ups.com";
$hostname = "linksworldwide.com";
$function = "GET";
$workFile = "/using/services/rave/qcostcgi.cgi";
$versionInfo = "HTTP/1.0\n\n";
$workString = "?";
$workString .= "accept_UPS_license_agreement=yes";
$workString .= "&";
$workString .= "10_action=$upsAction";
$workString .= "&";
$workString .= "13_product=$upsProduct";
$workString .= "&";
$workString .= "15_origPostal=$OriginPostalCode";
$workString .= "&";
$workString .= "19_destPostal=$DestZipCode";
$workString .= "&";
$workString .= "23_weight=$PackageWeight";
$workString .= "&";
$workString .= "22_destCountry=$input{'COUNTRY'}";
$request = "$function $workFile$workString $versionInfo";
$errmsg = "";
($name, $aliases,$proto) = getprotobyname('tcp');
($name, $aliases,$port) = getservbyport($port,'tcp') unless $port =~/^\d+$/;
($tname, $aliases,$type, $len, $thisaddr) = gethostbyname($hostname);
($name, $aliases,$type, $len,$thataddr) = gethostbyname($them);
$this = pack($sockaddr, $AF_INET, 0, $thisaddr);
$that = pack($sockaddr, $AF_INET, $port, $thataddr);
eval
{
if (socket(S, $AF_INET, $SOCK_STREAM, $proto) < 0)
{
$raveServer = 0;
print "Socket Failed<br>\n";
return 0;
}
select(S);
$| = 1;
select(STDOUT);
if (bind(S, $this) < 0)
{
$raveServer = 0;
print "Bind Failed<br>\n";
return 0;
}
if (!connect(S, $that))
{
$raveServer = 0;
print "Connect Failed<br>\n";
return 0;
}
};
print S "$request\n";
$resultlist = '';
while (<S>)
{
$resultlist .=$_;
}
close(S);
(@returnvals)=split(/\%/,$resultlist);
foreach $i (0 .. $#returnvals)
{
print "$returnvals[$i]<br>\n";
}
return $returnvals[10];
}
------------------------------
Date: Fri, 25 Jun 1999 07:46:35 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Re: Perl in Win32
Message-Id: <7kvc4p$u4a$1@nnrp1.deja.com>
Some people make it too complicated. I know what is going on...don't
just click perl.exe, you have to type (in dos)
perl my_script.pl
and then it will run my_script.pl, or atleast attempt to. Give it a
shot.
--
R.Joseph
http://www.24-7design.com
http://bowdown.to
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 25 Jun 1999 07:49:38 GMT
From: Freek Segers <segers@neroc.nl>
Subject: PerlScript & Session object
Message-Id: <7kvcag$u58$1@nnrp1.deja.com>
Hello,
I'm new to using PerlScript and I wondered if it will be possible to
store Perl objects (or normal hash references) in de Session object in
the future.
What is the best way around this at the moment?
Thanks,
Freek Segers
--
'Inheritance in Object Oriented Programming is
about software reuse,
and therefore related to Laziness, the principal
virtue of a programmer
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 25 Jun 1999 09:22:16 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: PerlScript & Session object
Message-Id: <37733C38.68B3CEA4@ericsson.com>
Freek Segers wrote:
>
> Hello,
>
> I'm new to using PerlScript and I wondered if it will be possible to
> store Perl objects (or normal hash references) in de Session object in
> the future.
Maybe, but doubtful. You'd have to ask Jan Dubois if he'll hack support
for automatically using Data::Dumper in the appropriate place - but I
very much doubt he'd want to do it (it's not really elegant) and I doubt
it's appropriate for Win32::OLE. Besides that, not many people really
care that much about that support.
> What is the best way around this at the moment?
Data::Dumper. Although you might struggle to restore some perl objects
(certainly DBI objects won't work - only things that are simple classes
to wrap up complex data types will work). See a recent discussion on the
ASPPerlscript list (www.asplists.com)
Matt.
------------------------------
Date: Fri, 25 Jun 1999 07:48:41 GMT
From: Ronny <ronald_f@my-deja.com>
Subject: Re: problems with chmod function
Message-Id: <7kvc8n$u51$1@nnrp1.deja.com>
In article <7kv4gq$n56$1@news.fsu.edu>,
bismuti@cs.fsu.edu (Peter Bismuti) wrote:
>
> I tried using the chmod function
>
> chmod($perm,$filename)
>
> where the striung $perm = '0775' for example. This didn't
> work like I thought it should, it set the permissions to all
> kinds of bizarre values. Can anyone explain why?
>
> Here is my script if you're intresested.
> @entry = stat($filename);
> $uid = $entry[4];
> if ($uid == $webmast_uid){
> $mode = $entry[2];
> $s_bit = $mode; $s_bit &= 07000; $s_bit /= 8**3;
> $u_bit = $mode; $u_bit &= 00700; $u_bit /= 8**2;
> $g_bit = $mode; $g_bit &= 00070; $g_bit /= 8**1;
> $o_bit = $mode; $o_bit &= 00007;
> $perm = $s_bit.$u_bit.$u_bit.$o_bit;
> chmod ($perm,$filename);
> }
Actually it is this code that looks a bit bizarre to me, but maybe
I'm only missing the point. Assume that $mode contains 0775, than we
have:
$s_bit == 0
$u_bit == 7
$g_bit == 7
$o_bit == 5
So you pass to chmod basically "0775". But chmod expects the argument as
a number, so it does something equivalent to "0775"+0, which is 775
and not 0775. If you use
$perm = oct "0.$s_bit.$u_bit.$u_bit.$o_bit";
this should work. Also,
chmod ($mode & 07777,$filename)
should deliver the same result.
Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 25 Jun 1999 10:32:40 GMT
From: baga@gmx.net (baga@gmx.net)
Subject: Reading Excel Sheets
Message-Id: <37735a00.13773425@news.techfak.uni-kiel.de>
Hello!
I want to read out special fields of an excel sheet with a perl
program. Does someone know if that is possible or not?
Thanks,
Hans
baga@gmx.net
------------------------------
Date: Fri, 25 Jun 1999 12:43:56 +0200
From: Henry Vermeulen <hvermeulen@correctnl.com>
Subject: Re: Regex question (i think)
Message-Id: <37735D6C.C30A65D8@correctnl.com>
Gene Dolgin wrote:
> How can i use regex to extract an email from a $string? Ive been trying
> for a while now and i can't get the entire email address. Its not for a
> spammer. Its for an email list converter (im switching mailing services
> and need to transfer the list)
>
> -gene
/<(*?)\@(*?)>/i;
Try something like this.
First part is in $1, second in $2.
Glue them together with a @ between.
But i'm sure there is a better way.
(took the idea of this regexp from
http://www.netcat.co.uk/rob/perl/win32perltut.html )
Henry
------------------------------
Date: Fri, 25 Jun 1999 07:31:19 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Using Tk or Win32::GUI in Win32
Message-Id: <7kvb87$tt9$1@nnrp1.deja.com>
I recently downloaded ActivePerl from ActiveState.com. I got it
working fine, but it says in the documentation that there is a way to
use the Tk module to do GUI programming in Win! Also, I downloaded a
module called Win32::GUI. I was able to produce a MsgBox call with it
and get it to actually DO a message box...but that was about it =).
Any help on this wierd yet interesting subject is greatly appreciated!
--
R.Joseph
http://www.24-7design.com
http://bowdown.to
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 25 Jun 1999 07:38:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: validating a regexp from a CGI form
Message-Id: <377427d9.1393337@news.skynet.be>
Andrew Allen wrote:
>: $sub = eval "sub { /$regexp/ }";
>
>: If $sub is undefined afterwards, it failed.
>
>And what's $@, chopped liver?
It is, in this, equivalent. If compilation succeeds, it returns a code
ref. It it fails, it will set $@ and return undef. But I think this is
more elegant than an alternative that uses $@:
$sub = eval "sub { /$regexp/ }" or die "Invalid regex";
Bart.
------------------------------
Date: Fri, 25 Jun 1999 07:38:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: What in my concatenated string?
Message-Id: <3773256f.775705@news.skynet.be>
AEF wrote:
>I made an a mess of a string, concatenating then using as a value for a
>hash.
>
>$string = '';
>$string .= ",$item";
>
>#etc.
>
>$hash{$key} = $string;
>
># actually it was a value for %Cookies
># I ended up with an interesting
># looking value
>
>@topics = split (/,/,$Cookies{'topics'} );
>
>print @topics;
>
>#because of the mistake gave me
>
>#,,,30,31,32 #for example
>
>#So I thought I would play with it and remove the ","
Longwinded story. IS the conclusion that you want this to be "30,31,21"?
Then I'd would try another way.
@topics = ('', '', '', 30, 31, 32);
$string = join ',', grep { $_ ne '' } @topics;
This will weed out the empty strings, and put comma's between the rest.
I hope this catches your problem.
Bart.
------------------------------
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 6124
**************************************