[12170] in Perl-Users-Digest
Perl-Users Digest, Issue: 5770 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 25 08:08:17 1999
Date: Tue, 25 May 99 05:00:25 -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 Tue, 25 May 1999 Volume: 8 Number: 5770
Today's topics:
', DBD and a dilemma (Steven Fletcher)
Re: ', DBD and a dilemma (Sam Holden)
? collecting data from URL, then save as text-file ? <PrinsPaul@DELETETHIShotmail.com>
Re: @INC - Require Problem <ubu@easynet.ca>
Does anyone have "mirror" v2.9 working on W95/NT? <swift@alum.mit.edu>
Re: Don't understand ctime / stat[10] (Greg Andrews)
Re: FAQ 8.45: How do I use an SQL database? (Steve MacLellan)
finding min in hash of hashes <dcollins@s3two.ie>
Re: finding min in hash of hashes (Sam Holden)
Re: Finding the date... <ubu@easynet.ca>
Re: Finding the date... (I R A Aggie)
Re: Hiding OLE Object in Perl <matt-news@sergeant.org>
How to use "system" with csh ?? <abelem@awi-bremerhaven.de>
Interactive User login & password for website bhagai@my-dejanews.com
Re: List of files in a directory? (I R A Aggie)
Re: Mac-specific Perl help requested - The Answer (yet (Larry Rosler)
need an anti-leech script <henjo@deadlock.et.tudelft.nl>
Net-IRC-0.58 (h3o)
parent directories <tim.shapcott@NOSPAMvirgin.net>
Perl Newbie (mike dombrowski)
Re: Perl on Win32 - How can I hide the process? (jon ewing)
Re: Perl Unicode/Multibyte Support <matt-news@sergeant.org>
Re: PERLFUNC: unshift - prepend more elements to the be (David Cantrell)
Re: PERLFUNC: unshift - prepend more elements to the be (Sam Holden)
print in different codepage = overload print? <pkotala@logis.cz>
reading a file and replace lines lasteyrie@iname.com
Re: Transliteration Operator Problem (Larry Rosler)
Re: What's wrong with this hit counter? <felixtse@crosswinds.net>
Re: What's wrong with this hit counter? (Bob Trieger)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 25 May 1999 11:35:18 GMT
From: flec@flec.co.uk (Steven Fletcher)
Subject: ', DBD and a dilemma
Message-Id: <375d8964.863086793@internal.news.shellnet.co.uk>
Hi all...
I have a little dilemma here that I can't quite decide on ;)
I've got the char ' from a variable read from STDIN. I'm a little stuck,
because they're giving me hassle. As I'm using perl to write to an SQL
database, the 's are erroring. Currently I've "fixed" it as so:
$buffer =~ s/'/`/go;
Using the other apostrophe that looks similar... only it's a little bit
of an odd thing because depending on what font they'll be looked in on
the web browser it makes not a lot of sense.
Is there any way that anyone knows to somehow still be able to display
the ' char but let the DBD system work as it should do?
TIA;
Steven Fletcher - steven@shellnet.co.uk
Shellnet - http://www.shellnet.com
------------------------------
Date: 25 May 1999 11:57:22 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: ', DBD and a dilemma
Message-Id: <slrn7kl412.imq.sholden@pgrad.cs.usyd.edu.au>
On Tue, 25 May 1999 11:35:18 GMT, Steven Fletcher <flec@flec.co.uk> wrote:
>Hi all...
>
>I have a little dilemma here that I can't quite decide on ;)
>
>I've got the char ' from a variable read from STDIN. I'm a little stuck,
>because they're giving me hassle. As I'm using perl to write to an SQL
>database, the 's are erroring. Currently I've "fixed" it as so:
>
>$buffer =~ s/'/`/go;
>
>Using the other apostrophe that looks similar... only it's a little bit
>of an odd thing because depending on what font they'll be looked in on
>the web browser it makes not a lot of sense.
>
>Is there any way that anyone knows to somehow still be able to display
>the ' char but let the DBD system work as it should do?
Escape them in whatever way the SQL dialect you are using uses...
\' is common in most places I would supect (but don't know).
'' is used by Access I think.
The documentation for the database should tell you.
--
Sam
I would like to tell you that Perl is simple in its complexity. But some
people won't understand that. So pretend I didn't say that, unless you
do. --Larry Wall
------------------------------
Date: Tue, 25 May 1999 10:28:45 +0200
From: "Paolo" <PrinsPaul@DELETETHIShotmail.com>
Subject: ? collecting data from URL, then save as text-file ?
Message-Id: <7idmps$k0mi$1@reader2.wxs.nl>
Hi,
First of all I must say I'm a Perl no-be and I guess I'm a Perl
never-will-be too.
Still I have this problem that I think even a Perl newbie can help me with.
I've looked at some perl-scripts and I think that what I have to accomplish
is easy to be done.
I have to collect some data from an ASP-page, giving my userid and password
that looks
like this :
http://www.somefirm.com/download.asp?ID=userid&PWD=pw
I would like to save the information it returns as a .txt-file.
The information returned looks like this:
8.12;7.99;6.00;1.99
Can anyone help me getting started?
Thanks in advance.
Paolo
------------------------------
Date: Tue, 25 May 1999 06:38:18 -0400
From: Barry Hemphill <ubu@easynet.ca>
To: mch@publinx.com
Subject: Re: @INC - Require Problem
Message-Id: <374A7D9A.C7F07526@easynet.ca>
I'd guess more likely that options.pm isn't in the current working directory, AKA ".",
of the web server when it executes start.cgi - on an NT server I have no clue what
that directory might be. When you run the program from the command prompt, "." is the
directory you're in which apparently contains options.pm, so your program has no
trouble finding it.
Try either:
a) Specify the full path in unshift - not a bad idea in general, although may affect
portability.
unshift @INC, "C:\path\to\options.pm";
b) Better yet, install options.pm somewhere that is already in @INC - if you don't
have permissions, ask the sysadmin copy the file into "C:\perl\site\lib\" or whatever
is appropriate for your system. Of couse, this kind of assumes the sysadmin won't put
it in without giving it the once over d:)
Hope this helps,
Barry
Abraham Grief wrote:
> Sorry if this gets posted multiple times, I'm having news
> problems.
>
> It's probably because when you get your webserver to run
> the program, it
> runs in taint mode. I'm not sure what is tainted about
> 'unshift (@INC, ".");', and I guess someone else can say
> why, I just know
> it doesn't work in taint mode. Just change all of your
> lines
> that say
>
> unshift (@INC, ".");
>
> into
>
> use lib '.';
>
> and you should be fine. Hope this helps.
>
> **** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
------------------------------
Date: Tue, 25 May 1999 06:45:05 -0400
From: "Matt Swift" <swift@alum.mit.edu>
Subject: Does anyone have "mirror" v2.9 working on W95/NT?
Message-Id: <1bv23.566$nn.157728@news.shore.net>
If so, what Perl are you using, and are there any fixes of mirror that you
are using?
I find that I have to hack the mirror script to avoid the use of a couple of
functions that don't seem to be implemented in W95 perl, e.g., getpwnam().
------------------------------
Date: 25 May 1999 04:11:47 -0700
From: gerg@shell1.ncal.verio.com (Greg Andrews)
Subject: Re: Don't understand ctime / stat[10]
Message-Id: <7ie0hj$3jk$1@shell1.ncal.verio.com>
tchrist@mox.perl.com (Tom Christiansen) writes:
> [courtesy cc of this posting mailed to cited author]
>
>In comp.lang.perl.misc, Joakim Hove <hove@ido.phys.ntnu.no> writes:
>:In another program, which analyses this file, I would like to compare
>:the creation time,
>
>Can't do that.
>
>:and the last modification time of this file. Now, I
>:do know that stat[10] gives the _inode_change_time_ which is different
>:from the creation time, however I thought the loop shown above would
>:not alter the ctime of $load_file, and hence in this particular case
>:ctime would equal creation time. However this seems to be wrong, for
>:every iteration ctime is updated, and ctime == mtime.
>
>When you update the mtime (or atime), you have updated metadata and
>thereby changed the inode. Since you've changed the inode, you of course
>now have to update the ctime.
>
Not on the Unix systems I've used. Just tested it on UFS filesystems
on Solaris 2.x and FreeBSD. Reading the file updates the atime only.
Else the distinction between atime and ctime would be meaningless.
The events that update the mtime seem to also trigger a ctime update,
but updating the atime doesn't.
-Greg
------------------------------
Date: Tue, 25 May 1999 11:13:57 GMT
From: maclell@col.ca (Steve MacLellan)
Subject: Re: FAQ 8.45: How do I use an SQL database?
Message-Id: <374a93bd.23177701@news.tor.metronet.ca>
On 24 May 1999 17:09:35 -0700, Tom Christiansen
<perlfaq-suggestions@perl.com> wrote:
> http://www.hermetica.com/technologia/perl/DBI/index.html .
No longer the correct URL. It has been moved to:
http://www.symbolstone.org/
Regards,
Steve MacLellan
_______________________________________
Dog BYTE FREE Classifieds
Newsletter and discussion
For Internet Marketers
http://welcome.to/dogbyte
_______________________________________
------------------------------
Date: Tue, 25 May 1999 11:57:07 +0100
From: Diarmuid Collins <dcollins@s3two.ie>
Subject: finding min in hash of hashes
Message-Id: <374A8203.DD1B0BB2@s3two.ie>
Hi,
I have created a hash of hashes something like :
%HoH = (
0 => {
size => '2',
type => 'a',
},
1 => {
size => '3',
type => 'a',
},
2 => {
size => '1',
type => 'a',
},
3 => {
size => '1',
type => 'a',
},
);
now what I'm trying to write is a subroutine that finds the hash with
the smallest size? Any ideas. I have been messing around with sorts
but it's driving me mad and I can't find anything in the FAQ..
Diarmuid
--
Diarmuid Collins | +353-1-2185544
Silicon & Software Systems Ltd | dcollins@s3two.ie
------------------------------
Date: 25 May 1999 11:34:44 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: finding min in hash of hashes
Message-Id: <slrn7kl2mk.dh1.sholden@pgrad.cs.usyd.edu.au>
On Tue, 25 May 1999 11:57:07 +0100, Diarmuid Collins <dcollins@s3two.ie> wrote:
>Hi,
> I have created a hash of hashes something like :
>%HoH = (
> 0 => {
> size => '2',
> type => 'a',
> },
> 1 => {
> size => '3',
> type => 'a',
> },
> 2 => {
> size => '1',
> type => 'a',
> },
> 3 => {
> size => '1',
> type => 'a',
> },
>);
>
>now what I'm trying to write is a subroutine that finds the hash with
>the smallest size? Any ideas. I have been messing around with sorts
>but it's driving me mad and I can't find anything in the FAQ..
By that data set you would be better off with an array of hashes..
sort {$HoH{$a}{size} <=> $HoH{$b}{size}} keys %HoH;
will give an array of keys in sorted order of the size attribute.
So
$HoH{(sort {$HoH{$a}{size} <=> $HoH{$b}{size}} keys %HoH)[0]};
would give the actual hash with the smallest size. Probably better
to do it in a few steps and improve readability.
You could also look at the 'get top N from M' or whatever it was sub that
was discussed in a thread last week.
Since you only want the smallest one you could also just loop through keeping
track of the minimum..something like :
($min_key,$min_size) = ();
while (($key,$value) = each %HoH) {
if (!defined $min_size or $value->{size} < $min_size)
{
$min_key = $key;
$min_size = $value->{size};
}
}
Though some may argue that is less understandable (and slower due to perl's
overhead for small data sets I suspect - but can't be bothered benchmarking).
--
Sam
People get annoyed when you try to debug them.
--Larry Wall
------------------------------
Date: Tue, 25 May 1999 06:22:55 -0400
From: Barry Hemphill <ubu@easynet.ca>
To: nick@auger.net
Subject: Re: Finding the date...
Message-Id: <374A79FF.2000574F@easynet.ca>
nick wrote:
> How can I find what day it was 7 days ago? If I use $day =
> (localtime(time))[3];, I can get todays date, and subtracting 7 from it
> will give me the date 7 days ago. But what if it is the 5th, then after
> subracting 7, it will give me -2. Is there an easy way to do this? Or
> am I gonna have to create a whole subroutine? Thanks in advance for
> help.
>
Personally I like to do things with simple math whenever I can - leave the
time as an integer while you manipulate it - so I'd do it something like
this:
$Days = 7;
$OtherTime = time - 86400 * $Days; # 86400 = 60 * 60 * 24; number of secs
in a day
Then $OtherTime can be used with localtime. One caveat; this will be off if
you happen to use it near Daylight Savings Time (although only if you use
it in just the right hour, 12:00-1:00am), so for most purposes the above is
close enough. To be more precise, the method posted by Dave Cross looks
fine except for the fact that he seems to be counting on 23 hour days? We
only have one of those a day where I come from, and we offset it with a 25
hour day a few months later d:)
$then += ($delta * 23 * 60 * 60);
^^ shouldn't that be 24?
Hope this helps,
Barry
------------------------------
Date: 25 May 1999 11:06:08 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Finding the date...
Message-Id: <slrn7kl16m.6h4.fl_aggie@thepentagon.com>
On Tue, 25 May 1999 06:22:55 -0400, Barry Hemphill <ubu@easynet.ca>, in
<374A79FF.2000574F@easynet.ca> wrote:
+ $Days = 7;
+ $OtherTime = time - 86400 * $Days; # 86400 = 60 * 60 * 24; number of secs
+ in a day
+
+ Then $OtherTime can be used with localtime. One caveat; this will be off if
+ you happen to use it near Daylight Savings Time (although only if you use
+ it in just the right hour, 12:00-1:00am),
Larry R. has a function that does this correctly, and has been submitted
to the PFR (Perl Function Repository), and should be in Deja.com. It is
only for 1 day, but the number of days should be a trivial modification...
James
------------------------------
Date: Tue, 25 May 1999 11:30:44 +0100
From: Matt Sergeant <matt-news@sergeant.org>
Subject: Re: Hiding OLE Object in Perl
Message-Id: <374A7BD4.A1886AE9@sergeant.org>
Jeremy Gurney wrote:
>
> I'm not sure about the perl syntax but in vb you'd set
> activeworkbook.saved=true
> (would that be $excel->ActiveWorkbook->Saved=>true ?)
Almost:
$excel->ActiveWorkbook->{Saved} = 1;
------------------------------
Date: Tue, 25 May 1999 12:19:14 +0200
From: Andre Belem <abelem@awi-bremerhaven.de>
Subject: How to use "system" with csh ??
Message-Id: <374A7922.D99E3B6D@awi-bremerhaven.de>
Hello Guys,
I wrote a small perl script that works with 2 different unix programs,
using the "system" procedure. But I'm getting in trouble with one of
them.
Here is part of my script:
#!/bios4/user1/LWperl5/bin/perl
...
my $SWscript = "/bios4/user1/HAWI/SWl01/runl1a"; # full name of runl1a
script
my $L0dir = "/bios4/user1/HAWI/L0/";
my $namelev0 = "S1999077105755.L0_HAWI";
system("$SWscript $L0dir.$namelev0");
...
The command for system is /bios4/user1/HAWI/SWl01/runl1a
/bios4/user1/HAWI/L0/S1999077105755.L0_HAWI
^^^^^^^^^^^^
^^^^^^^^^^^^
unix program argument
used by runl1a
Here is only an example. The argument used by the program comes from
some string operations that I do on the perl script.
The problem is that runl1a executes an unix "source" command to upload
environment variables...and IT IS NOT DOING THAT!
When I type in the command line "/bios4/user1/HAWI/SWl01/runl1a
/bios4/user1/HAWI/L0/S1999077105755.L0_HAWI" the program runs well, but
it doesn't using "system". WHY ??
So..then I made a copy of only this part of the program, on a small perl
script, and IT IS RUNNING !
I don't understand why sometimes the Perl script runs and sometimes not.
Could somebody help me ?? I need to know how the system works for a csh
program using system.
Regards
Andre
--
Andre L. Belem
Alfred-Wegener Insitut f|r Polar- und Meeresforschung
Postfach 12 01 61
D-27515 Bremerhaven
Phone: +49-471-4831-809
FAX : +49-471-4831-425
Take an Ice Tour at http://www.awi-bremerhaven.de/Eistour/index-e.html
Also very interesting is
http://www.awi-bremerhaven.de/Eistour/seawifs/index-e.html
------------------------------
Date: Tue, 25 May 1999 08:22:06 GMT
From: bhagai@my-dejanews.com
Subject: Interactive User login & password for website
Message-Id: <7idmjc$eff$1@nnrp1.deja.com>
HI,
I am looking for software packages or scripts
that I can add to my website inorder to make a
certain area of the website available only to
people who register. I would like to send them
there password by email to verify it & give them
the possibilty to change it afterwards.
Thank you,
Hagai
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 25 May 1999 11:11:21 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: List of files in a directory?
Message-Id: <slrn7kl1gf.6h4.fl_aggie@thepentagon.com>
On 24 May 1999 14:27:15 -0700, Tom Christiansen <tchrist@mox.perl.com>, in
<3749b623@cs.colorado.edu> wrote:
+ [courtesy cc of this posting mailed to cited author]
+
+ In comp.lang.perl.misc, fl_aggie@thepentagon.com writes:
+ :Back to the orginal poster. There is a reason why <*> may not always
+ :work -- it relies upon an underlying shell to do the dirty work of listing
+ :the files.
+
+ Fixed in the next release.
We're not worthy, we're not worthy!
James - well, ok, maybe csh isn't worthy either...
------------------------------
Date: Sun, 23 May 1999 23:20:25 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Mac-specific Perl help requested - The Answer (yet another followup)
Message-Id: <MPG.11b28f8967fe7b9b989a4a@nntp.hpl.hp.com>
In article <3748E22A.60BF@bitwell.net> on Mon, 24 May 1999 05:19:14 GMT,
Josh Pointer <josh@bitwell.net> says...
> Henry Penninkilampi wrote:
> >
> > First, you seem to be forgetting that it is the *operating system* which
> > defines what ASCII code represents a given key (code), not the
> > application. When you're on a *Mac*, it's ASCII 13, on a *Unix* box it's
> > ASCII 10. It's an operating system issue, pure-and-simple. If you want
> > to point a 'you started it all' finger at someone, then blame Apple for
> > thinking different back in 1984.
>
> Henry, \n is not an operating system definition; it's a Perl definition.
> On UNIX, it corresponds to ASCII 10 (\f?). On Mac, ASCII 13 (\r). The
> mapping of \n is not immutable.
It is not "\f", which is ASCII 12 (FF == formfeed). In fact ASCII 10 is
LF (linefeed), and the escape sequence "\l" *should* mean that, but it
doesn't. "\12" or "\x0A" or chr(10) are the portable representations.
Within Perl (or C or C++) strings, "\n" also always represents this
character, no matter what the external representation (in a file) of the
newline is.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 25 May 1999 10:12:46 +0200
From: Henjo <henjo@deadlock.et.tudelft.nl>
Subject: need an anti-leech script
Message-Id: <Pine.LNX.3.96.990525101032.2759A-100000@deadlock.et.tudelft.nl>
Hi all,
I'm constantly losing bandwidth because other people are linking directly
to my files.
Can anyone give me a script which prevents this?
I've already searched on the net, but couldn't find anything free/working.
Or at least give me some hints on how to achieve this, so maybe I can
write it myself.
Thanks!
----------------------
Henjo
http://come.to/henjo
sirhenjo@hotmail.com
ICQ# 18616700
----------------------
------------------------------
Date: Tue, 25 May 1999 10:18:42 +0000
From: h3o@veda.is (h3o)
Subject: Net-IRC-0.58
Message-Id: <h3o-ya02408000R2505991018420001@news.proventum.net>
hello.
am experiencing difficulty in comprehension of the DCC module from
Net-IRC-0.58. DCC works, but there appears to be something that has to be
set buffer-wise on accepting a file and the creation of an object to
represent it (at a wild guess). the error message I am getting is:
"no child process created"
and any file is saved to disk with only its first few bytes intact - and
this is from the test script supplied with the module, with no
modifications other than the local machine names and IRC servers.
can anyone enlighten me as to how to prevent the file runcation?
TIA
andrew mckenzie
------------------------------
Date: Tue, 25 May 1999 11:33:45 +0100
From: "Tim Shapcott" <tim.shapcott@NOSPAMvirgin.net>
Subject: parent directories
Message-Id: <7idugb$b0d$1@nclient1-gui.server.virgin.net>
Hi
I have finally got my script to work, and you cannot comprehend just how
happy I am.
However, I now have a new problem. I get a return from the host saying the
page requested does not exist on the server. If you want to have a look, go
to www.moreno-band.freeserve.co.uk and click on the geustbook button in the
navbar, the on sign guestbook in the main page area.
I think the problem is due to specifying a parent directory in the script; i
am not sure how to do this, so it probably isn't right.
$directory_gbook = "../guestsv.html";
$guestbook = "../guestsv.html";
$cgi = "/guest.cgi";
The script is obviously in cgi-bin, but guestsv.html is up one level. The
way to do it in HTML is ../ but it doesn't seem to work here.
Any suggestions?
Thanks
Tim
------------------------------
Date: Tue, 25 May 1999 10:51:29 GMT
From: legodude@home.net (mike dombrowski)
Subject: Perl Newbie
Message-Id: <374a8136.131864454@24.2.68.71>
I just recently got into perl and I rather like it. But in the course
of my screwing around I ran into a problem.
#-------------begin my code-------------
if(!(($xartist eq "") || ($xsongname eq ""))){
$mike = $xartist . "--" . $xsongname . ".mp3";
$mike =~ s/\ /\-/g;
#--------------------------------here it is---------------------------
#$mike =~ s/ ' | ` | & | : | ? /_/g;
#Here's the line that's giving me trouble, as you can probly see I'm
#taking a mp3 file, reading the artist and songname then renaming the
#mp3 to artist--songname.mp3 I run into problems when ' ` : ? etc are
#in the song title. How would I filter them out completely?
#$mike =~ s/`/\-/g;
#print "\n \n $mike \n \n";
$mmd = $mp3;
$mmd =~ s/\ /\\\ /g;
$mmd =~ s/\(/\\\(/g;
$mmd =~ s/\)/\\\)/g;
#print "\n \n $mmd \n \n";
if($songname eq "") { print "Songname: $xsongname | "; }
if($artist eq "") { print "Artist: $xartist | "; }
if($album eq "") { print "Album: $xalbum | "; }
if($year eq "") { print "Year: $xyear | "; }
if($comment eq "") { print "Comment: $xcomment | "; }
if($genre eq "") { print "Genre: $xgenre\n"; }
if (!($mmd eq $mike)){
system "mv $mmd $mike";
}
}
#-------------end my code-------------
Also, this has been asked millions of times before but what is a good
perl website that has tutorials?
Thanks
Mike
------------------------------
Date: 25 May 1999 05:45:10 -0500
From: jon@webdev.co.uk (jon ewing)
Subject: Re: Perl on Win32 - How can I hide the process?
Message-Id: <374b7e25.68089787@news1.newscene.com>
I use this to hide the DOS box - the box appears, then disappears
again almost immediately. If you specify in a shortcut to the script
that it should run minimized then its hardly noticeable at all. I
can't remember if these modules are part of the Win32 Perl
distribution or not.
use Win32::FileOp;
use Win32::GUI;
## Get the shell window and minimize it...
$handle = Win32::FileOp::GetWindowHandle();
Win32::GUI::CloseWindow($handle);
Win32::GUI::Hide($handle);
Looking at it now, I'm not sure both of the calls to Win32::GUI are
necessary - sorry, but I haven't got time to test it out now.
Hope this helps,
jon.
>Actually I believe that option is to be used when STARTing another batch
>file(other than the calling batch file). And that's not the problem. I'm
>looking on how to hide the DOS box that Perl uses when it starts.
>Lewis Perin wrote:
>
>> Thomas/Shurflo <thomas@shurflo.com> writes:
>>
>> > Anyone know how I can hide the process (dos box) that starts when I run
>> > a Perl script? It could take a while to run and I don't want users
>> > seeing it.
>> >
>> > I've been through the manuals and the newsgroups.
>>
>> In a DOS box on the NT or 9X system you use, type
>>
>> start /? | more
>>
>> and you'll see the info you seek.
>>
>> Cheers, Lew
>
>
------------------------------
Date: Tue, 25 May 1999 11:35:29 +0100
From: Matt Sergeant <matt-news@sergeant.org>
Subject: Re: Perl Unicode/Multibyte Support
Message-Id: <374A7CF1.746CC99@sergeant.org>
"J|rgen Exner" wrote:
>
> > NAME
> > utf8 - Perl pragma to turn on UTF-8 and Unicode support
>
> Ok, sounds really great to me.
> But what about true Unicode support (i.e. not converted into UTF-8)?
> That's a problem I'm facing right now.
Err.... what's not unicode about utf-8? Encoding is irrelevant to
whether or not it's Unicode.
If you need to convert to/from utf-16 try the Unicode::* modules.
Matt.
------------------------------
Date: Tue, 25 May 1999 08:43:09 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: PERLFUNC: unshift - prepend more elements to the beginning of a list
Message-Id: <374a6204.408905364@news.insnet.net>
On 25 May 1999 01:54:25 -0700, Tom Christiansen
<perlfaq-suggestions@perl.com> enlightened us thusly:
>This excerpt is from the perlfunc manpage ...
Tom, can you please stop posting these? I am beginning to find these
posts far more annoying than the newbies' FAQs. And it's not
preventing them from wasting our time.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: 25 May 1999 09:15:36 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: PERLFUNC: unshift - prepend more elements to the beginning of a list
Message-Id: <slrn7kkqho.nej.sholden@pgrad.cs.usyd.edu.au>
David Cantrell <NukeEmUp@ThePentagon.com> wrote:
>On 25 May 1999 01:54:25 -0700, Tom Christiansen
><perlfaq-suggestions@perl.com> enlightened us thusly:
>
>>This excerpt is from the perlfunc manpage ...
>
>Tom, can you please stop posting these? I am beginning to find these
>posts far more annoying than the newbies' FAQs. And it's not
>preventing them from wasting our time.
You could just killfile perlfaq-suggestions@perl.com...
--
Sam
Fifty years of programming language research, and we end up with C++ ???
--Richard A. O'Keefe
------------------------------
Date: Tue, 25 May 1999 12:14:50 +0200
From: "Pavel Kotala" <pkotala@logis.cz>
Subject: print in different codepage = overload print?
Message-Id: <927627523.218306@gate.logis.cz>
I would like to specify in which codepage I want to print t STDOUT. I wold
like to use function print (if it is possible).
Can I owerload sub print? How take I arguments then? I mean how I recognize
these situations:
print 'txt'
print FILE 'txt'
print 'txt','txt2'
print FILE 'txt',txt2
Thank You
Pavel Kotala
------------------------------
Date: Tue, 25 May 1999 08:50:52 GMT
From: lasteyrie@iname.com
Subject: reading a file and replace lines
Message-Id: <7ido9b$fjk$1@nnrp1.deja.com>
I Got a file (not made by me) within line like that :
"
<HTML>
Name : $Name<BR>
</HTML>
"
and i want my script to replace $Name by is value $Name in my program :
for example:
$Name="Lasteyrie"
The program must return :
"
<HTML>
Name : Lasteyrie<BR>
</HTML>
"
The problem is that i have nearly 60 variable, i don't want to process
them one by one.
How can i do that ?
If you didn't understant my question, i can give examples !!!
thanx
--
Laurent de Lasteyrie
URL:http://www.ima.uco.fr/~hobbes
email:lasteyrie@iname.com
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Sun, 23 May 1999 23:22:47 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Transliteration Operator Problem
Message-Id: <MPG.11b290136b6e5809989a4b@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7iao4b$c0u$1@nnrp1.deja.com> on Mon, 24 May 1999 05:29:48
GMT, billy_collins@my-dejanews.com <billy_collins@my-dejanews.com>
says...
...
> Pls help..the documentation is VERY brief about the TR operator. How do
> I change full strings inside TR and not just characters?
The 'tr' (translate) operator changes characters *only*. To change
strings, you need to use the 's' (substitute) operator. Q.v.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 25 May 1999 17:14:49 +0800
From: Felix <felixtse@crosswinds.net>
Subject: Re: What's wrong with this hit counter?
Message-Id: <374A6A09.1554A9@crosswinds.net>
Why still not OK?
Code:
#!/usr/bin/perl -w
use diagnostics;
use strict;
if (-r "counter.log" && -w "counter.log"){
open(LOG,"counter.log") || die "cannot open";
chomp($count = <LOG>);
$count++;
print LOG "$count";
@digits=split(//,sprintf("%05d",$count));
print "Content-type:text/html\n\n";
print "<Html>";
print "<Head>";
print "<Title>Hit counter</Title>";
print "</Head>";
print "<Body>";
print "<p>";
foreach my $digit (@digits) {
print qq(<img src="count$digit.gif" alt="" width="20" height="30">);
}
print "</p>;
print "</Body>";
print "</Html>";
}
------------------------------
Date: Tue, 25 May 1999 10:23:06 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: What's wrong with this hit counter?
Message-Id: <7ids4b$r4p$1@birch.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
Felix <felixtse@crosswinds.net> wrote:
>Why still not OK?
>
>Code:
>#!/usr/bin/perl -w
>use diagnostics;
>use strict;
>
>if (-r "counter.log" && -w "counter.log"){
You aren't locking the file, why bother testing for them?
>open(LOG,"counter.log") || die "cannot open";
You should include the $! variable in your die message. It will tell you
why it died.
>chomp($count = <LOG>);
This won't work using strict, did you test this before posting?
>$count++;
>print LOG "$count";
You can't write to a filehandle that is only open for reading.
perldoc -f open
>@digits=split(//,sprintf("%05d",$count));
This won't work using strict. You have to declare the @digits array.
>print "Content-type:text/html\n\n";
The should be a space after the colon.
>print "<Html>";
>print "<Head>";
>print "<Title>Hit counter</Title>";
>print "</Head>";
>print "<Body>";
>print "<p>";
>
>foreach my $digit (@digits) {
>print qq(<img src="count$digit.gif" alt="" width="20" height="30">);
>}
>
>print "</p>;
>print "</Body>";
>print "</Html>";
>}
You really could use some help with style also, for instance you should
be indenting in the if and foreach loops and not using so many print
statements.
------------------------------
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 5770
**************************************