[19130] in Perl-Users-Digest
Perl-Users Digest, Issue: 1325 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 18 14:05:41 2001
Date: Wed, 18 Jul 2001 11:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <995479516-v10-i1325@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 18 Jul 2001 Volume: 10 Number: 1325
Today's topics:
Re: about image::Magick quality please ! <shijialee@yahoo.com>
Re: All computers in world MUST sync with ATOMIC clock <rhux@cs.brown.edu>
Re: All computers in world MUST sync with ATOMIC clock <pne-news-20010718@newton.digitalspace.net>
ANNOUNCE: "Compiler" 2.0beta1 <aotto@t-online.de>
Re: DBD::MSSQL module ??? <peb@bms.umist.ac.uk>
Re: DBD::MSSQL module ??? <peb@bms.umist.ac.uk>
Re: DBD::MSSQL module ??? (isterin)
Re: Debugger -- ActivePerl / Perl Builder / Perltk / <mjcarman@home.com>
Re: Email Question <tom.melly@ccl.com>
Re: Getting always corrupt files while uploading (cgi) <buggs-clpm@splashground.de>
Re: How to timeout a socket recv under win32? (Anno Siegel)
imagemagick/perlmagick for windows 2000 <danield@life.uiuc.edu>
Re: imagemagick/perlmagick for windows 2000 <news@simonflack.com>
Re: imagemagick/perlmagick for windows 2000 <danield@life.uiuc.edu>
Re: imagemagick/perlmagick for windows 2000 <danield@life.uiuc.edu>
Re: imanewbie <gnarinn@hotmail.com>
Re: Including flock in code while developing in Windows <jeff@vpservices.com>
Re: Including flock in code while developing in Windows <m.grimshaw@salford.ac.uk>
OT: Re: Tail -f for NT (Steven M. O'Neill)
Re: Recommendations for a 2nd book on Perl <fty@mediapulse.com>
Re: Removing .coms <lwalker@ecn.purdue.edu>
Re: Removing .coms (Blstone77)
Re: Removing .coms (Jay Tilton)
Re: Strange thing happened today! (Tad McClellan)
Tail -f for NT (Buck Turgidson)
Re: Tail -f for NT <neil@alaweb.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 18 Jul 2001 14:17:35 GMT
From: "James" <shijialee@yahoo.com>
Subject: Re: about image::Magick quality please !
Message-Id: <3Ug57.508$2V.116870@news3.rdc1.on.home.com>
sorry, i was not clear for my question.
My script did resize the pic, i.e a pic with 685x547 and 103k became 70x55
and 6.86k.
but when i further change the quality in order to make the resized image
smaller. it seems the pic remains the same no matter what quality i set(
since the pic remains the same size , i.e still 6.86k. i suppose the quality
matters with the 'size').
hopes it's clear now.
thx
"James" <shijialee@yahoo.com> wrote in message
news:9Ga57.205298$Mf5.56805120@news3.rdc1.on.home.com...
> question again,
>
> i am trying to resize image and lower the quality in order to make a
smaller
> thumbnail. i am specifically dealing with JPEG file now. My problem is
that
> the
> size of the image seems not to be affected no matter what number i set
> for the quality. even with nothing set for the quality! the size always
> remains the same.
>
> btw, i used GD to do the same job, but end up with losing much quality of
> the image.
>
> _______________________________________________
>
> use Image::Magick;
>
> $image = Image::Magick->new;
> $image->Read('1012.jpg');
> $test = $image->Clone();
>
> my ($w,$h) = $test->Get('width','height');
>
> &getNewSize;
>
> $test->Resize(width=>$w,height=>$h);
> $test->Write(quality=>'50',filename=>'copy.jpg');
>
> -----------------------------------------------
>
> i am new to perl , please give me any thought you may have, thanks!
>
> James
>
>
>
>
------------------------------
Date: Wed, 18 Jul 2001 13:26:49 -0400
From: hux <rhux@cs.brown.edu>
Subject: Re: All computers in world MUST sync with ATOMIC clock before 12:00 AM 21July 2001
Message-Id: <3B55C6D9.D79CA0F3@cs.brown.edu>
--------------8348D48E740DE905245169ED
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Did you study under the great Psychoceramics Professor Josiah Carberry?
--
-Hux
Every program has two purposes --
written and another for which it wasn't.
William Pietri wrote:
>
> alavoor wrote:
> >
> > All computers in the world MUST sync with ATOMIC clock before 12:00 AM
> > 21 July 2001!!!
>
> And why must we do that? Will the UFOs leave us behind if we are not in
> perfect isocrhronal synchrony? Must our computers be temporally harmonized
> to properly receive the waves of spiritual energy when you immanentize the
> eschaton? And in which time zone do you mean? There are 24 different 12:00
> AMs on July 21.
>
> I haven't been reading the papers lately, so I'm very behind in all this.
> Please bring me up to date.
>
> > hello:
> > You must sync your PC's date and time with Cesium Atomic clock.
> >
> > Use this very small and tiny program written in PHP.
> >
> > Do you know that Cesium Atomic clock located in Boulder, Colarado, USA
> > is the world's most accurate clock!! It does not lose or gain one second
> > even after running for 25 MILLION YEARS!!! This clock is the official
> > time USA and for the world.
>
> I am sorry to inform you that there is now a more accurate clock.
>
> http://dailynews.yahoo.com/h/abc/20010713/ts/opticalclock010713_1.html
>
> The mercury ion clock will only slip one second every 30 billion years,
> which is much better. Does this mean we will have longer to install the
> program you mention? I'd think it would give us at least until Tuesday.
>
> > There are also similar Atomic clocks in France, UK, Germany and Japan.
> >
> > This program runs on MS Windows 95/98/NT/2000/XP/ME and MS Windows 3.11.
> >
> > This program also runs on all flavors of Unix and Linux and Apple Mac.
> >
> > Please download the program from:
> > http://phpclasses.upperdesign.com/browse.html/package/285
>
> I will take a look immediately. Oh, and given your interest in timekeeping,
> you may find this site helpful; I know I've found it very interesting:
>
> http://www.timecube.com/
>
> Regards,
>
> William Pietri
> Field Researcher
> Institute for Psychoceramics
--------------8348D48E740DE905245169ED
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Did you study under the great Psychoceramics Professor Josiah Carberry?
<p>--
<br> -Hux
<p>Every program has two purposes --
<br>written and another for which it wasn't.
<p>William Pietri wrote:
<blockquote TYPE=CITE>
<br>alavoor wrote:
<br>>
<br>> All computers in the world MUST sync with ATOMIC clock before 12:00
AM
<br>> 21 July 2001!!!
<p>And why must we do that? Will the UFOs leave us behind if we are not
in
<br>perfect isocrhronal synchrony? Must our computers be temporally harmonized
<br>to properly receive the waves of spiritual energy when you immanentize
the
<br>eschaton? And in which time zone do you mean? There are 24 different
12:00
<br>AMs on July 21.
<p>I haven't been reading the papers lately, so I'm very behind in all
this.
<br>Please bring me up to date.
<p>> hello:
<br>> You must sync your PC's date and time with Cesium Atomic clock.
<br>>
<br>> Use this very small and tiny program written in PHP.
<br>>
<br>> Do you know that Cesium Atomic clock located in Boulder, Colarado,
USA
<br>> is the world's most accurate clock!! It does not lose or gain one
second
<br>> even after running for 25 MILLION YEARS!!! This clock is the official
<br>> time USA and for the world.
<p>I am sorry to inform you that there is now a more accurate clock.
<p> <a href="http://dailynews.yahoo.com/h/abc/20010713/ts/opticalclock010713_1.html">http://dailynews.yahoo.com/h/abc/20010713/ts/opticalclock010713_1.html</a>
<p>The mercury ion clock will only slip one second every 30 billion years,
<br>which is much better. Does this mean we will have longer to install
the
<br>program you mention? I'd think it would give us at least until Tuesday.
<p>> There are also similar Atomic clocks in France, UK, Germany and Japan.
<br>>
<br>> This program runs on MS Windows 95/98/NT/2000/XP/ME and MS Windows
3.11.
<br>>
<br>> This program also runs on all flavors of Unix and Linux and Apple
Mac.
<br>>
<br>> Please download the program from:
<br>> <a href="http://phpclasses.upperdesign.com/browse.html/package/285">http://phpclasses.upperdesign.com/browse.html/package/285</a>
<p>I will take a look immediately. Oh, and given your interest in timekeeping,
<br>you may find this site helpful; I know I've found it very interesting:
<p> <a href="http://www.timecube.com/">http://www.timecube.com/</a>
<p>Regards,
<p>William Pietri
<br>Field Researcher
<br>Institute for Psychoceramics</blockquote>
</html>
--------------8348D48E740DE905245169ED--
------------------------------
Date: Wed, 18 Jul 2001 19:14:14 +0200
From: Philip Newton <pne-news-20010718@newton.digitalspace.net>
Subject: Re: All computers in world MUST sync with ATOMIC clock before 12:00 AM 21July 2001
Message-Id: <mlgbltcclbb3cjq9t01d97n9baabueepv1@4ax.com>
[Please don't top-post. Please trim quotes appropriately. Please don't
quote signatures. Thanks.]
On Wed, 18 Jul 2001 12:32:09 +0200, "carlos"
<carlos@plant.student.utwente.nl> wrote:
> isn't that why the NTP protocol uses UDP?
I highly doubt it. I don't think that the choice of TCP vs UDP makes
that much of a difference in the round-trip times. If you have a thin
link or you're far away netwise from the NTP server, you'll still have
to compensate for the time the packets take to get to you.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Wed, 18 Jul 2001 17:22:51 +0200
From: Andreas Otto <aotto@t-online.de>
Subject: ANNOUNCE: "Compiler" 2.0beta1
Message-Id: <3B55A9CB.2628AD82@t-online.de>
Dear Customer,
"Compiler" 2.0beta1, a tool for creating native binaries ot of Tcl
code
is available for download.
Please refer to:
http://www.compiler-factory.com/01_07_17-press_E.html
for the public press release
Your Sincerely
Compiler Factory Team
--
================================================================
(C) Compiler-Factory Phone: ++49-(0)8152-399540
Dipl.-Ing Andreas Otto mailto:info@compiler-factory.com
Business Solutions http://www.compiler-factory.com
Ulmenstrasse 3 => "Compiler", FastWeb, OpMenu
D-34289 Zierenberg => C, C++, Tcl, HTML, database,
=================================================================
------------------------------
Date: Wed, 18 Jul 2001 15:45:33 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: DBD::MSSQL module ???
Message-Id: <3B55A10D.A791DF5A@bms.umist.ac.uk>
Paul Boardman wrote:
>
> Fred wrote:
>
> > Is there any DBD::MSSQL module available? Otherwise anybody tryed to access
> > such kind of db through the DBD::ODBC? Did it work fine?
>
> Yes. DBD::mysql.
oops... sorry, I missread the module name.
The answer is still yes. MSSQL::DBlib.
Paul
------------------------------
Date: Wed, 18 Jul 2001 15:43:41 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: DBD::MSSQL module ???
Message-Id: <3B55A09D.C064D51@bms.umist.ac.uk>
Fred wrote:
> Is there any DBD::MSSQL module available? Otherwise anybody tryed to access
> such kind of db through the DBD::ODBC? Did it work fine?
Yes. DBD::mysql.
Paul
------------------------------
Date: 18 Jul 2001 09:10:40 -0700
From: isterin@hotmail.com (isterin)
Subject: Re: DBD::MSSQL module ???
Message-Id: <db67a7f3.0107180810.6217008d@posting.google.com>
"Fred" <f_dubru@yahoo.com> wrote in message news:<TRe57.91$H57.14508172@news2.randori.com>...
> Hi,
>
> Is there any DBD::MSSQL module available?
No, use DBD::ODBC or DBD::Sybase.
>Otherwise anybody tryed to access
> such kind of db through the DBD::ODBC? Did it work fine?
Worked fine:)
>
> Thanks for the feed-back.
>
> Fred.
------------------------------
Date: Wed, 18 Jul 2001 08:17:45 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Debugger -- ActivePerl / Perl Builder / Perltk /
Message-Id: <3B558C79.1ADFE58C@home.com>
Joe Chung wrote:
>
> I found 3 popular perl debugger, which one is the best?
Whichever one works best for you. Play with them, see how you like using
them. I normally just use perl -d, but have found ptkdb to be handy at
times as well.
> I perfer writing perl code on windows and run on Unix. I wonder if
> perl code is portable across different platform, like Java code?
Probably moreso. :)
Most of the time a well-written script will be completely portable
between different platforms, but there are some things to be aware of.
Not all of the builtin functions are implemented on all platforms. Most
of those which aren't have to do with sysadmin tasks and herald back to
Perl's birthplace on Unix. They aren't available on Win* because they
have no meaning there.
And of course, if you like making liberal use of system(), exec(), and
backticks (that is, calls to the OS) you'll have problems with
portability. :)
> Does ActivePerl come with the standard perl interpreter?
ActivePerl is a distribution of Perl for Win32 platforms. It contains a
port of the interpreter.
> so that I can write code using ActivePerl, then run it on unix's
> perl. Any compatiblity problem?
Rarely. It's actually pretty easy to write portable Perl most of the
time. See the perlport manpage for a full description of things to keep
in mind. There are also manpages for specific platform oddities
(perlwin32, perlos2, etc.)
Other things to keep in mind is whether or not your Win* and *nix
machines are running different versions of Perl, and whether you have
all of the same modules available on both platforms.
-mjc
------------------------------
Date: Wed, 18 Jul 2001 14:12:19 +0100
From: "Tom Melly" <tom.melly@ccl.com>
Subject: Re: Email Question
Message-Id: <3b558b33$0$3755$ed9e5944@reading.news.pipex.net>
"John Almberg" <jalmberg@identry.com> wrote in message
news:c396bdba.0107180442.dfe228a@posting.google.com...
<snip>
How about just sending plain text? If the pictures are essential, then they can
be sent as attachements. It might not look as "pretty" as HTML, but a) it will
work b) it won't irritate people and c) "pretty" is an innaccurate adjective if
they just get a load of image spacers.
If your market men (pah!) insist on html, it should at least be an option rather
than the default.
> After thinking about this overnight, I am surprised that the images
> (just a few, mall ones)
I don't think image content is the issue ;)
------------------------------
Date: Wed, 18 Jul 2001 17:18:56 +0200
From: Buggs <buggs-clpm@splashground.de>
Subject: Re: Getting always corrupt files while uploading (cgi)
Message-Id: <9j496u$had$00$1@news.t-online.com>
Georg Vassilopulos wrote:
> Hi People,
>
> Just a simple piece of code, but not working.
> What is the bug here?
>
> use CGI qw(:standard);
> my $file = $query->param('Datei');
> open (UPFILE, ">$myFile");
binmode(UPFILE);
?
> while (read($file, $buffer, 1024)) { print UPFILE $buffer; };
> close (UPFILE);
Buggs
------------------------------
Date: 18 Jul 2001 14:33:37 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to timeout a socket recv under win32?
Message-Id: <9j46o1$o39$1@mamenchi.zrz.TU-Berlin.DE>
According to Bart Lateur <bart.lateur@skynet.be>:
> Benjamin Goldberg wrote:
>
> >> So you mean recv().
> >
> >Umm, what do you mean by that comment?
>
> Oops, I have ben mixing threads. I cconfused this with another current
> thread, where the OP asked how you can know how many bytes there are
> currently available for reading.
>
> It all boils down to this: how do you receive all the data that the
> other side is sending to you, without waiting for more that won't come?
> How do you know that, for the moment, the transmission is complete?
>
> <S>, read, sysread, recv are similar yet different. I guess that only
> read() is not usable. select() or IO::Select can tell you that something
> is available, but not how much. I have the feeling that there isn't a
> real generic solution, that the sender somehow HAS to indicate how long
> the transmission will be. Otherwise, the receiver can stop receiving too
> soon, or wait for something that won't come.
There must be *some* protocol sender and receiver agree upon, but
not necessarily pre-announcement of length. If the sender always
sends complete lines, even read() is usable, because a transmission
isn't finished unless a line is finished.
Or am I solving a different problem?
Anno
------------------------------
Date: Wed, 18 Jul 2001 10:57:16 -0500
From: "Daniel Davidson" <danield@life.uiuc.edu>
Subject: imagemagick/perlmagick for windows 2000
Message-Id: <bli57.1721$oz3.22430@vixen.cso.uiuc.edu>
I have been trying to get perlmagick to work in windows 2000 for a good bit
now. It may be related to the directions asking for you to move imagick.dll
and xll.dll to the perl\bin directory. Howeer these files are never created
no matter wich of the build options I do.
So to simplify the directions, does anyone have a step by step process to
install perlmagick in a win2k machine?
thanks,
Dan
------------------------------
Date: Wed, 18 Jul 2001 17:19:58 +0100
From: "Simon Flack" <news@simonflack.com>
Subject: Re: imagemagick/perlmagick for windows 2000
Message-Id: <9j4cvu$m7erb$1@ID-83895.news.dfncis.de>
> I have been trying to get perlmagick to work in windows 2000 for a good
bit
> now. It may be related to the directions asking for you to move
imagick.dll
> and xll.dll to the perl\bin directory. Howeer these files are never
created
> no matter wich of the build options I do.
Those dlls come with the binary version of ImageMagick - a 2mb download.
Alternatively, (if you are using ActivePerl), just type:
ppm install Image::Magick
in your command prompt.
Simon
------------------------------
Date: Wed, 18 Jul 2001 12:35:22 -0500
From: "Daniel Davidson" <danield@life.uiuc.edu>
Subject: Re: imagemagick/perlmagick for windows 2000
Message-Id: <9Xj57.1763$oz3.22985@vixen.cso.uiuc.edu>
that creates a file magick.dll, I take it is the same thing?
Dan
"Simon Flack" <news@simonflack.com> wrote in message
news:9j4cvu$m7erb$1@ID-83895.news.dfncis.de...
> > I have been trying to get perlmagick to work in windows 2000 for a good
> bit
> > now. It may be related to the directions asking for you to move
> imagick.dll
> > and xll.dll to the perl\bin directory. Howeer these files are never
> created
> > no matter wich of the build options I do.
>
> Those dlls come with the binary version of ImageMagick - a 2mb download.
>
> Alternatively, (if you are using ActivePerl), just type:
>
> ppm install Image::Magick
>
> in your command prompt.
>
> Simon
>
>
------------------------------
Date: Wed, 18 Jul 2001 12:45:41 -0500
From: "Daniel Davidson" <danield@life.uiuc.edu>
Subject: Re: imagemagick/perlmagick for windows 2000
Message-Id: <9Xj57.1764$oz3.22985@vixen.cso.uiuc.edu>
This creates a file magick.dll, is it the same as imagick.dll??
thanks again,
Dan
"Daniel Davidson" <danield@life.uiuc.edu> wrote in message
news:bli57.1721$oz3.22430@vixen.cso.uiuc.edu...
> I have been trying to get perlmagick to work in windows 2000 for a good
bit
> now. It may be related to the directions asking for you to move
imagick.dll
> and xll.dll to the perl\bin directory. Howeer these files are never
created
> no matter wich of the build options I do.
>
> So to simplify the directions, does anyone have a step by step process to
> install perlmagick in a win2k machine?
>
> thanks,
>
> Dan
>
>
------------------------------
Date: Wed, 18 Jul 2001 12:58:05 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: imanewbie
Message-Id: <995461085.657933307345957.gnarinn@hotmail.com>
In article <9j1qr9$ojv$1@slb6.atl.mindspring.net>,
TedWeb <ted_godwin@mindspring.com> wrote:
>Hello everyone,
>
>I am sending data to a perl script from a web-page using POST. The script
>defines variables and prints out a response page. However, when the script
>runs, the browser pops up a dialog box for saving a file??? I realize that
>this is probably a rather simple problem with an evasive solution... can
>someone help?
>
you are not using CGI.pm?
gnari
------------------------------
Date: Wed, 18 Jul 2001 09:51:55 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Including flock in code while developing in Windows for Unix??
Message-Id: <3B55BEAB.C9FB91@vpservices.com>
Bart Lateur wrote:
>
> if(eval "use Fcntl qw(:flock); 1") # has flock()
Except that that doesn't work (and uses evil string eval :-)). On my
win98, it lies and tells you flock is available. I wrote the correct
answer at the start of the thread:
use constant HAS_FLOCK => eval { flock STDOUT, 0; 1 };
--
Jeff
------------------------------
Date: Wed, 18 Jul 2001 18:59:57 +0100
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: Including flock in code while developing in Windows for Unix??
Message-Id: <3B55CE9D.A19B8EE8@salford.ac.uk>
Jeff Zucker wrote:
>
> Bart Lateur wrote:
> >
> > if(eval "use Fcntl qw(:flock); 1") # has flock()
>
> Except that that doesn't work (and uses evil string eval :-)). On my
> win98, it lies and tells you flock is available. I wrote the correct
> answer at the start of the thread:
>
> use constant HAS_FLOCK => eval { flock STDOUT, 0; 1 };
>
> --
> Jeff
That seems to work fine - thanks. What's wrong with string eval? I
based my code on pp403-404 of Perl Cookbook which specifically states
that you must use eval "string" rather than eval {BLOCK} to trap
compile-time events (which 'use' is).
------------------------------
Date: 18 Jul 2001 17:42:09 GMT
From: steveo@panix.com (Steven M. O'Neill)
Subject: OT: Re: Tail -f for NT
Message-Id: <9j4hph$kb2$1@news.panix.com>
Buck Turgidson <jc_va@hotmail.com> wrote:
>I have been searching perldocs and newsgroups for a workable version
>of tail for NT. I couldn't get the stuff that I did find to work.
>
>Does anyone have a simple way of doing tail -f on NT?
The Cygwin tools are ports of the popular GNU development tools and
utilities for Windows. They function by using the Cygwin library
which provides a UNIX-like API on top of the Win32 API.
http://sources.redhat.com/cygwin/
--
Steven O'Neill steveo@panix.com
www.cars-suck.org
------------------------------
Date: Wed, 18 Jul 2001 13:30:28 GMT
From: "Jay Flaherty" <fty@mediapulse.com>
Subject: Re: Recommendations for a 2nd book on Perl
Message-Id: <Ubg57.124102$Pf4.11444109@bin1.nnrp.aus1.giganews.com>
"blackpike" <blackpike@my-deja.com> wrote in message
news:45a3895e.0107170826.def53eb@posting.google.com...
> tommyumuc@aol.com (JR) wrote in message
news:<319333f5.0107120647.42e8c42e@posting.google.com>...
> > I would appreciate any suggestions anyone may have for a second book
> > on Perl. The first book through which I have gone is "Sams-Teach
> > Yourself Perl in 24 Hours" (how ridiculous is that?). I use the
> > "Programming Perl" and "CGI/Perl Cookbook" as reference books, but I
> > really need a good second "how-to" book on Perl
Definitely the Perl Cookbook by Tom Christiensen and Nathan Torkington.
I also like Effective Perl Programming by Joseph Hall with Randal Schwartz.
I recently bought Object Oriented Perl by Damian Conway had love it.
jay
------------------------------
Date: Wed, 18 Jul 2001 08:28:50 -0500
From: Laron Andrion Walker <lwalker@ecn.purdue.edu>
To: Blstone77 <blstone77@aol.com>
Subject: Re: Removing .coms
Message-Id: <Pine.GSO.4.33.0107180826540.13125-100000@min.ecn.purdue.edu>
$string=~s/.com//g;
$string~=s/.org//g
$string~=s/.net//g
On 18 Jul 2001, Blstone77 wrote:
> Newbie question. Does anyone know of a simple way to remove anything with the
> extentions .com, .org, or .net from a string? I tried substitution
> $string =~ s /s+.*?.com//sg;
>
> but this removes everything from first space. What am I missing, and is there a
> better way.
>
------------------------------
Date: 18 Jul 2001 13:38:11 GMT
From: blstone77@aol.com (Blstone77)
Subject: Re: Removing .coms
Message-Id: <20010718093811.11290.00000010@ng-fv1.aol.com>
>$string =~ s/\.(com|net|org)//g;
This doesn't work, it does the same thing that my original substitution code
did. namely, it removes the .com but leaves the domain. In other words,
newbie.com becomes newbie. I am trying to remove the whole thing (newbie.com)
or userplace.com when it is in a string such as a message. Does anyone know
what I am doing wrong. See my message below:
>
>"Blstone77" <blstone77@aol.com> wrote in message
>news:20010718073012.19801.00000001@ng-fn1.aol.com...
>> Newbie question. Does anyone know of a simple way to remove anything with
>the
>> extentions .com, .org, or .net from a string? I tried substitution
>> $string =~ s /s+.*?.com//sg;
>>
>> but this removes everything from first space. What am I missing, and is
>there a
>> better way.
------------------------------
Date: Wed, 18 Jul 2001 15:29:12 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Removing .coms
Message-Id: <3b55a7e0.180285204@news.erols.com>
On 18 Jul 2001 11:30:12 GMT, blstone77@aol.com (Blstone77) wrote:
>Newbie question. Does anyone know of a simple way to remove anything with the
>extentions .com, .org, or .net from a string? I tried substitution
>$string =~ s /s+.*?.com//sg;
>
>but this removes everything from first space. What am I missing, and is there a
>better way.
There are several mistakes.
s/s+.*?.com//sg;
^ ^ ^ ^Useless unless you expect a newline to be
^ ^ ^ embedded within a domain name.
^ ^ ^Should be backslashed.
^ ^Matches anything including space. This is what's removing too much.
^Needs backslash.
Try this instead.
$string =~ s/\s+\S*?\.(?:com|org|net)//g;
------------------------------
Date: Wed, 18 Jul 2001 09:18:39 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Strange thing happened today!
Message-Id: <slrn9lb35f.cs2.tadmc@tadmc26.august.net>
millside <millettNOSPAM@lblueyonder.co.uk> wrote:
>Any option/suggestions other than the obvious one of deleting the cgi-bin?
You are looking for the problem in the wrong place.
Your problem has nothing to do with Perl.
Sounds like a web server setup problem or something. You should
ask in a newsgroup about web servers.
>HELP!
No need to shout.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 18 Jul 2001 06:17:39 -0700
From: jc_va@hotmail.com (Buck Turgidson)
Subject: Tail -f for NT
Message-Id: <f98999c8.0107180517.436dd646@posting.google.com>
I have been searching perldocs and newsgroups for a workable version
of tail for NT. I couldn't get the stuff that I did find to work.
Does anyone have a simple way of doing tail -f on NT?
Much appreciated.
Buck
------------------------------
Date: Wed, 18 Jul 2001 12:30:47 -0500
From: "Neil" <neil@alaweb.com>
Subject: Re: Tail -f for NT
Message-Id: <tlbhvd4qtpri05@corp.supernews.com>
---- Original Message -----
From: "Buck Turgidson" <jc_va@hotmail.com>
Newsgroups: comp.lang.perl.misc
Sent: Wednesday, July 18, 2001 8:17 AM
Subject: Tail -f for NT
> I have been searching perldocs and newsgroups for a workable version
> of tail for NT. I couldn't get the stuff that I did find to work.
>
> Does anyone have a simple way of doing tail -f on NT?
>
> Much appreciated.
>
> Buck
I use this ....
use Win32::ChangeNotify;
my (@stat, $beginsize, $endsize, $notify, $directory, $file );
$directory = '\\\\machine\\shared_dir\\sub_dir'; # for machines on your
network
# $directory = 'C:/shared_dir/sub_dir'; # for your local
machine
$file = $directory . '\\file_to_tail.log';
print "Monitoring $file...\n\n";
while (1) {
@stat = stat("$file");
$beginsize=$stat[7];
$notify = Win32::ChangeNotify->new($directory,0,'LAST_WRITE') or die
"$^E";
$notify->wait or warn "Something failed: $!\n";
@stat = stat($file);
$endsize=$stat[7];
if ($beginsize != $endsize)
{
open (CRONLOG, $file);
seek (CRONLOG, $beginsize,0);
my $contents = 1;
while ($contents)
{
read (CRONLOG, $contents, 1024);
print $contents;
}
close (CRONLOG);
} # End if
} # Wend
As you can see - I embedded the name of the file to "tail -f" but it could
have been included as a command line arg. But I am lazy - and being a
Windows user - would prefer to click and have it start, rather than go to
DOS and type...and I have just a few files I usually tail ... so I have
several with filenames embedded ;-)
But - maybe this will prompt me to "get off my a**" and write the routine to
accept command line args !
Neil
------------------------------
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 1325
***************************************