[7759] in Perl-Users-Digest
Perl-Users Digest, Issue: 1384 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 28 06:07:21 1997
Date: Fri, 28 Nov 97 03:00:22 -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 Fri, 28 Nov 1997 Volume: 8 Number: 1384
Today's topics:
[Q] uuencode difference <acsm@ccs.neu.edu>
Re: deleting a line in an ascii file <keithlol@nospammindspring.com>
Re: Embarrassing Perl Code (was PERL Hourly Rates) <ebohlman@netcom.com>
hash of hashes or hash? <designky@sonnets.dot.com>
Re: Newbie question. Do you recommend moving from C? <greg@hassan.com>
Re: open(), seek() and email monitoring <andrewe@technologyXchange.com>
Re: PERL Hourly Rates <ebohlman@netcom.com>
Re: perl shorter than csh challenge!! <markm@nortel.ca>
Re: perl shorter than csh challenge!! <markm@nortel.ca>
Re: perl shorter than csh challenge!! (William Wei Liong Young)
Re: Print out array! (Tad McClellan)
Re: Print out array! (Tad McClellan)
Re: Safe use of flock() -- was Re: giving up on flock <markm@nortel.ca>
Re: Sendmail <greg@hassan.com>
Re: SIG-signals <qdtcall@esb.ericsson.se>
Re: Simulation & modeling (Andy Leigh)
Re: Strange 'print Location:' problem with Perl <greg@hassan.com>
Re: sytem command test (brian d foy)
Re: Trying to copy a file on winnt in perl... <metcher@no.junk.mail>
Re: undump <mweber@atlas.de>
Re: Winnt and Unix Communication (Tye McQueen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Nov 1997 03:51:44 GMT
From: Anthony S Chow <acsm@ccs.neu.edu>
Subject: [Q] uuencode difference
Message-Id: <65lf4h$s4v$1@camelot.ccs.neu.edu>
I tried to achieve uuencode by the following pseudo-Perl:
while(read IN, $buffer, 45){
print STDOUT pack("u", $buffer);
}
The code works sometimes, but not all the times. I compare the output
of this with uuencode. Some files I attempted to encode, there are
difference only at the last few bytes .. do you happen to know anything
I miss? Thanks in advance.
--
Anthony S Chow in Boston, Massachusetts, USA
For more information: please visit http://www.ccs.neu.edu/home/acsm
------------------------------
Date: 28 Nov 1997 08:28:03 GMT
From: "Keith M." <keithlol@nospammindspring.com>
Subject: Re: deleting a line in an ascii file
Message-Id: <01bcfbd7$aa219800$d22d56d1@www.keithlol.com>
Asmat Ullah <asmat@cad.strath.ac.uk> wrote in article
<347D4C24.15FB@cad.strath.ac.uk>...
> I have a flat file, containing a delimited(:) line by line list of names
> and address, telephone numbers etc.
> I need to know how to delete a line from this flat file.
> example line:
> Joe:Bloggs:MR:332442:Joe@someplace.com:Room1111
> Please advise on best solution.
> Thanks
> Asmat
Try this..
open(FILE,"path/filename") || die $!;
@users = <FILE>;
close (FILE);
foreach $file_line (@users) {
if ($file_line =~ /Joe:Bloggs:MR:332442:Joe@someplace.com:Room1111/) {
$file_line =~ s/$file_line//; ##<this will completely remove the
line.
}
}
#Now go save the file.................
open(FILE,"path/filename") || die $!;
foreach $file_line (@users) {
print FILE "$file_line"; #Save the updated user file
}
close(FILE);
Hope this helps... Keith M.
------------------------------
Date: Fri, 28 Nov 1997 05:32:02 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Embarrassing Perl Code (was PERL Hourly Rates)
Message-Id: <ebohlmanEKCCpF.5HB@netcom.com>
Terry Michael Fletcher - PCD ~ <tfletche@pcocd2.intel.com> wrote:
: a few months ago, i was looking through a "guestbook" type script i had
: from back in the days. i was trying to disallow certain words from being
: posted with a pattern match. i had no perl book, no perl knowledge, no
: one to ask questions (that i knew of). i saw this type of pattern
: match in a script:
: /[Mm]ozilla/
: and realized what the brackets did, but i didnt know a /i modifyer
: existed, so to match all ways a word could be written, i did this:
: /[Tt][Ee][Rr][Rr][Yy]/
: i ROTFL when i saw that i did that.... :-0
In earlier versions of tin (like the one I was using until a few days
ago) you *had* to do that in order to make a killfile entry case-sensitive.
------------------------------
Date: Fri, 28 Nov 1997 01:37:16 -0600
From: designky <designky@sonnets.dot.com>
Subject: hash of hashes or hash?
Message-Id: <347E74AC.348C3DF1@sonnets.dot.com>
I am writing a database program and is wondering which to use. I want to be
able to extract stat for any year, month, day, and hour easily. Here are two of
the models that I am thinking of using:
model 1 : $hash{yymmdd}[hour] = hits
or
model 2 : $hash{yy}{mm}{dd}[hour] = hits
Which is a better model to use? which one can provide faster performance? This
is going to be a cgi program, amd it might get a lot of hits.
Is there an easy/fast way to extract stat for any given month and year easily
with model one? like given 9711, and quickly calculate the stat for the month,
and the highest?
At this point, i am using model 2, but then when I need to find out the highest
hits for a day, it is kind of a long process, since i have to go through all of
them, with several for loops, but with model 1, i can use with only 1 loop. Any
comments?
Thanks.
--
-----------------------------------------------------------------------------
Kang Soon Lai skang_at_nori.lips.net | "If there is any religion that would
http://www.tisl.ukans.edu/~skang/ | cope with modern scientific needs
(913) 385 5481 | it would be Buddhism."
Software Engineer | --Albert Einstein
------------------------------
Date: Thu, 27 Nov 1997 14:18:03 -0500
From: Greg Hassan <greg@hassan.com>
To: Programming <sysdev@mb.sympatico.ca>
Subject: Re: Newbie question. Do you recommend moving from C?
Message-Id: <347DC76B.71B0@hassan.com>
Programming wrote:
>
> I have been experiencing
> "the joy of C" the past few months.
>
I would say Perl and Java can handle most of your needs.
They allow you to crank out what you want a lot faster
then a comparable C program.
And when you need it, you already know C so you should
be all set.
I haven't used C for much in my web-based business except when
adding to old code. Sometimes its faster to rewrite the whole
C program with the new additions in Perl. :)
-Greg
--
===============================================================
Greg Hassan, The Independent Solution (CGI,Java,SQL,Perl...)
http://www.hassan.com/, 1-607-225-4214
===============================================================
Online Editable Database: http://www.hassan.com/super_dbedit/
Form's Submissions Tracker: http://www.hassan.com/form/
Sell Stuff on the Web: http://www.hassan.com/shopcart/
===============================================================
------------------------------
Date: Fri, 28 Nov 1997 11:52:58 +0800
From: Andrew Ellerton <andrewe@technologyXchange.com>
Subject: Re: open(), seek() and email monitoring
Message-Id: <347E401A.399FB0A@technologyXchange.com>
Jan Krynicky wrote:
> > > andrewe@technologyXchange.com (Andrew Ellerton) wrote:
> > >
> > > > I'm trying to write some code to monitor email spool files and do
> > > > anything once new email is received.
> > > > Although the approach may be wrong, I'm presently trying this code
> > > > virtually straight out of Programming Perl:
> > > > <snipped>
..
> I think this is awrong approach (at least on unix).
> Look at
> $ man forward
> through this you may forward the incoming mail into your program.
>
> Create a file .forward in your home directory containing
> something like
>
> | /home/myself/the-script
> \myself
> <snip>
> Jenda
Thanks Jenda,
Using your approach my email "answering machine" is now working very
well!
Many thanks, and regards,
Andrew
--
Andrew Ellerton andrewe@technologyXchange.com
Software Engineer +61 8 9367 7006
International Technology Exchange Fax +61 8 9367 7343
Australia http://www.technologyXchange.com
------------------------------
Date: Fri, 28 Nov 1997 05:50:57 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: PERL Hourly Rates
Message-Id: <ebohlmanEKCDKx.642@netcom.com>
Mark Mielke <markm@nortel.ca> wrote:
: I'm in highschool and have known perl and its internals quite well in the
: last 5 years. I find it quite... distasteful... that some of my peers are
: taking "jobs" to write html pages and get paid $20+/hour. That's a rip-off
: to the companies fuck... it's only worth minimum wages. I also have several
Actually, that's not as high as you think, assuming they're doing the work
on an independent contractor basis, doing it on their own equipment, etc.,
rather than as employees using company facilities. For that sort of work,
the fully-burdened cost of an employee is usually about twice his/her
salary, so paying a contractor $20/hour costs a company the same as paying
an employee $10/hour. Assuming that one Canadian dollar is $.75 US, that
works out to $7.50 US, which is 45% over minimum wage ($5.15). In some
high-cost-of-living parts of the US, MacDonalds pays that much for
flipping burgers.
Independent contractors command a premium over employees because 1) they,
rather than the employer, incur the overhead and 2) the company gets the
convenience of having to pay only when they have actual work to be done.
In the US, there's a third factor: they don't have to pay health
insurance for the employee.
Another reason for contracting out things like Web design rather than
doing them in-house is that you can use more experienced people. If a
company does one or two jobs a year in-house, their people are never
going to get very far on the learning curve. Unless business is so slow
that much of the in-house staff is sitting around twiddling their thumbs,
trying to do this sort of thing in-house means adding more work to people
who already have a full workload. Something has to give, and it usually
means cutting corners in the extra work.
------------------------------
Date: 27 Nov 1997 23:40:07 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: perl shorter than csh challenge!!
Message-Id: <lq1zpmpd42g.fsf@bmers2e5.nortel.ca>
i0l1@ugrad.cs.ubc.ca (William Wei Liong Young) writes:
> my limited yet growing experience in perl has shown me that pretty
> much anything done in a csh shell script can be done in fewer or the
> same lines of code in a perl script ( fewer lines...not speed, efficiency,
> blah, blah). but i think i have come across two lines of csh code which
> I can't seem to write in 2 lines of perl code (using currently 'built-in'
> perl, not extra modules).
> Here is situation:
> We have a text file with arbitrary number of lines:
> a = 1
> b = 2
> c = 3
> d = 4
> ....
> In a csh script, to get the value of c (assuming all the values on the left
> side of the equal sign are unique):
> set str = `grep c filename`
> set cvalue = $str[ 3 ]
> Can anyone do the same in perl using only 2 lines (and that includes opening
> any filehandles)?
How about: $cvalue = (split(/\s+/, `grep c filename`))[2];
> just thought I would throw this quite unimportant, rather insignificant
> question to the group. obviously, using back ticks in your perl code
> doesn't count :), and the more confusing the two lines the better ;)
Oops... no backticks? But... but... you're using them for you csh script...
That's not very fair...
--- CUT HERE ---
use FileHandle;
$cvalue=(split(/\s+/,(grep(/c/,new FileHandle("filename")->getlines))[0]))[2];
--- CUT HERE ---
Good enough for you? :-) No error checking, but then again, YOU don't do
any error checking.
And then again, you could try out this and see what you think:
perl -ane 'print"$F[2]\n"if$F[0]eq"c"' filename
NOTE:
I most certainly DO NOT recommend the use of ANY of the
above constructs in production code.
have fun all :-)
mark
-- _________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Northern Telecom Ltd. |
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | Box 3511, Station 'C' |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, ON K1Y 4H7 |
markm@nortel.ca / al278@freenet.carleton.ca |_______________________|
------------------------------
Date: 28 Nov 1997 00:12:28 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: perl shorter than csh challenge!!
Message-Id: <lq1wwhtd2kj.fsf@bmers2e5.nortel.ca>
Mark Mielke <markm@nortel.ca> writes:
> --- CUT HERE ---
>use FileHandle;
>$cvalue=(split(/\s+/,(grep(/c/,new FileHandle("filename")->getlines))[0]))[2];
> --- CUT HERE ---
> Good enough for you? :-) No error checking, but then again, YOU don't do
> any error checking.
Hmmm... just after posting i thought of a nicer/cleaner/terser method...
Here's both versions... one easy to read, one less so:
# Easy to read version...
use FileHandle;
($cvalue) = map {/^c = (.*)$/} new FileHandle("filename")->getlines();
# Minimal version (unnecessary characters stripped)
use FileHandle;
($cvalue)=map/^c = (.*)/,new FileHandle("filename")->getlines;
If anybody actually wants me to explain how this works... ask... :-)
(also note that this version handles the following cases:
a = 1
b = c <--- the old `grep c ...` will match this... bad...
c = 2 4 5 <--- this version will return "2 4 5". The csh one just says 2.
d = 3
Wheras the csh one doesn't. :-) )
> NOTE:
> I most certainly DO NOT recommend the use of ANY of the
> above constructs in production code.
I still stand by this :-)
-- _________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Northern Telecom Ltd. |
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | Box 3511, Station 'C' |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, ON K1Y 4H7 |
markm@nortel.ca / al278@freenet.carleton.ca |_______________________|
------------------------------
Date: 28 Nov 1997 06:14:00 GMT
From: i0l1@ugrad.cs.ubc.ca (William Wei Liong Young)
Subject: Re: perl shorter than csh challenge!!
Message-Id: <65lnf8$f2a$1@nnrp.cs.ubc.ca>
: # Easy to read version...
: use FileHandle;
: ($cvalue) = map {/^c = (.*)$/} new FileHandle("filename")->getlines();
: # Minimal version (unnecessary characters stripped)
: use FileHandle;
: ($cvalue)=map/^c = (.*)/,new FileHandle("filename")->getlines;
I like it...i'm impressed :). but....part of the challenge was:
> I can't seem to write in 2 lines of perl code (using currently 'built-in'
> perl, not extra modules).
So what do you think Mark, think you can do it without 'use'ing anything?
but if you can't...don't worry, i'm still impressed :)
Will
------------------------------
Date: Thu, 27 Nov 1997 21:00:04 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Print out array!
Message-Id: <k3cl56.lg4.ln@localhost>
Ryujiy (ryujiy@aol.com) wrote:
: This is a part of my program. This program is supposed to print out even
: number of element of the array(@starray[0,2,4, ...so on]), but it prints put
: odd number of element of the array(@starray[1,3,5...so on]). I don't
: understand the reason.
Me either...
: Could someone explain me?
... because your code is formatted so strangely that I'm disinclined
to try and understand it.
Please don't type in programs. Use cut/paste or a file include instead.
Otherwise you will get several followups addressing your typos,
and (maybe) none addressing your question, because nobody could
get past the typos...
: @files = qw(
: aug.txt
: dec.txt );
: string = "Hello World";
^
^ $string meant here?
: $count1 = 0;
: $numfile = $#files;
: while ($files[$count1]){
: $target = `grep -i $string $files[$count1]`;
^^^^^^^
If this is from the line above, then won't grep be searching for
the string 'Hello', first in a file named 'World', and then in
the file named in $files[$count1] ?
: @starray = split (/:/,$target); #The result of grep is divided and
: stored as an element of array
Another syntax error because it got word wrapped...
: $numarray = $#starray; #Get number of array element
^^^^^^^^^^^^^^^^^^^^^^^
That gets one LESS than the number of array elements (if $[ = 0, the default)
It gets the _index of the last element_
They are usually different...
:
: if ($target ne '') {
: for ($count2 = 0; $count2 <=
: $numarray; $count2+=2) {
: print "The string is\n" ;
: print
: "$starray[$count2]\n\n";
: }
See, got all the way to the end just pointing out the complaints I
got from perl while trying to run the above 'code'.
You want people to actually try the code, and their fix, don't you?
I cannot spend the time to patch it up into a runnable state.
Sorry.
for ($i=0; $i<@starray; $i++) {
print $starray[$i] unless $i % 2;
}
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 27 Nov 1997 21:23:02 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Print out array!
Message-Id: <medl56.1j4.ln@localhost>
Tad McClellan (tadmc@metronet.com) wrote:
: Ryujiy (ryujiy@aol.com) wrote:
: : This is a part of my program. This program is supposed to print out even
: : number of element of the array(@starray[0,2,4, ...so on]), but it prints put
: : odd number of element of the array(@starray[1,3,5...so on]). I don't
: : understand the reason.
: for ($i=0; $i<@starray; $i++) {
: print $starray[$i] unless $i % 2;
: }
Uhh. Now why would I go and write that?
for ($i=0; $i<@starray; $i+=2) {
print $starray[$i];
}
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 27 Nov 1997 22:57:00 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: Safe use of flock() -- was Re: giving up on flock
Message-Id: <lq13ekhekmr.fsf@bmers2e5.nortel.ca>
keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com (Keith Willis) writes:
> On 23 Nov 1997 17:14:49 -0500, Mark Mielke <markm@nortel.ca> wrote:
> >Any ideas people? _SHOULD_ i be checking the return code of close() in
> >C + perl scripts?Let's just say i wrote my code like this:
> >--- CUT HERE ---
> >use Fcntl qw(:flock);
> >use IO::File;
> >
> >sub log
> >{
> > my($path, $message) = @_;
> > my $handle = new IO::File($path, "a") ||
> > die "open of $path failed: $!\n";
> >
> > flock($handle, LOCK_EX) ||
> > die "lock could not be obtained for $path: $!\n";
> >
> > seek($handle, 0, SEEK_END) ||
> > die "seek-to-eof failed for $path: $!\n";
>
> I am probably missing something here (and this is not related to the
> subject of flock), but if you open the file with a type of "a", why
> would you need to do a SEEK_END as well?
OOoooOOoo i can answer that :-)
What does append mean? It means open for writing, but do a seek() to
the current end of the file automatically. Now, flock() will keep us from
continuing until we get can a chance at getting "exclusive" access
to the file... If someone else is writing to the file, we continue when
they are _done_ doing whatever the heck they wanted to do. A possible
consequence of this is that by the time we get exclusive access to the file,
it's length might be different from when we first opened the file.
(for the case of a log file, if someone else has touched it you are almost
guaranteed that it is now one or more lines longer :-) ) So, after the
flock() we have to seek() to the current eof after everybody else has
finished fiddling with the file.
mark
-- _________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Northern Telecom Ltd. |
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | Box 3511, Station 'C' |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, ON K1Y 4H7 |
markm@nortel.ca / al278@freenet.carleton.ca |_______________________|
------------------------------
Date: Thu, 27 Nov 1997 13:57:28 -0500
From: Greg Hassan <greg@hassan.com>
To: Chris Russell <ca5cru@isis.sund.ac.uk>
Subject: Re: Sendmail
Message-Id: <347DC298.5FF2@hassan.com>
Chris Russell wrote:
>
> Hi,
>
> I`m new to the group so if this question has been asked before,
> then I apologise.
>
> I have a number of perl scripts from university that use sendmail
> ala piping to sendmail xxx@xxx.co.uk ...
>
> These used to work fine, but now they dont .. they run fine under
> linux but no longer at uni ..
>
> I have heard about some SUID patch which may have stopped this working
> .. scripts were on 705 with no SUID ..
>
You shouldn't need suid on your script to access sendmail.
Did you check that sendmail has the same path on the new machine?
usually, /usr/lib/sendmail. Also, check the man page, maybe
it is a different version, using slightly different arguments.
Can you use sendmail through a telnet session? if not maybe
have a talk with your sys admin, something on the new system
could be messed up.
if you can't get that to work, maybe switch to mail or mailx
to send the mail.
Or you could connect directly to the mail port and talk to
the daemon. I am sure you can figure out how to do that, if you
wander around perl.com for a while.
Always more then one way to do it,
-Greg
--
===============================================================
Greg Hassan, The Independent Solution (CGI,Java,SQL,Perl...)
http://www.hassan.com/, 1-607-225-4214
===============================================================
Online Editable Database: http://www.hassan.com/super_dbedit/
Form's Submissions Tracker: http://www.hassan.com/form/
Sell Stuff on the Web: http://www.hassan.com/shopcart/
===============================================================
------------------------------
Date: 28 Nov 1997 09:14:25 +0100
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: SIG-signals
Message-Id: <isyb29cu5a.fsf@godzilla.kiere.ericsson.se>
sap1d@canit.se (Johan Dalstrom) writes:
> It's working fine with one exeption.. You can press ^Z to
> put the program in the background and then kill it.
> Is there a SIG-signal for ^Z so i can disable that function?
This is not really a Perl question, but a Unix tty-interface question.
You need to read up on the way your particular unix handles such
things.
Given that, the signal you want to trap is quite likely SIGTSTP.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: Fri, 28 Nov 1997 06:06:34 GMT
From: andy@legion.demon.co.uk (Andy Leigh)
Subject: Re: Simulation & modeling
Message-Id: <347d1267.2271786@news.demon.co.uk>
Berni,
Thanks for your help. I think that I've decided that I won't be able
to do huge amounts of simulation in Perl. Instead I'll use dedicated
tools for the day-job. What I'll do with Perl is build some simple
queue models and manipulate them to get a better feel for what the
queues are really doing.
--
Andy
Bernard Weiler <pmp@egnetz.uebemc.sie.de> wrote:
> Andy Leigh wrote:
> >
> > I'm curious to know if anyone has built any Discrete-event simulations
> > using Perl. I know there are lots of languages well suited to such an
> > enterprise, but I'm a lousy programmer, and don't have time to learn
> > another language (I'm not exactly sparkling at Perl)
> >
> > I've had a look through a news archive and CPAN, but can't see any
> > relevant references. If you've done some experimenting or I've missed
> > an obvious thread, please let me know.
> >
> > --
> > Andy Leigh
>
> We scheduled an information transition simulator for telecommunication
> equipment. We arn't really sure about implementing
> a huge core like the one in VHDL.
>
> berni
> --
> --------------------
> Name: Bernard Weiler
> Org.: OeN TR HW A, Mch-H, Siemens AG
> email: pmp@egnetz.uebemc.sie.de (add 'mens' to 'sie'; Sorry, spamming
> suppression)
> PGP: the public key may be downloaded from
> pgp-public-keys@uni-paderborn.de
------------------------------
Date: Thu, 27 Nov 1997 14:25:25 -0500
From: Greg Hassan <greg@hassan.com>
To: Tim Gilman <tdgilman@DELETETHISbest.com>
Subject: Re: Strange 'print Location:' problem with Perl
Message-Id: <347DC925.44A0@hassan.com>
Tim Gilman wrote:
>
> I don't get it. Like I said before, if I hard code in the filename, like:
>
> print "Location: sib97181.pdf\n\n";
>
I would check to be sure that the string coming in from the
form is exactly what you have above. If this works and the string
from the form is the same, then it should work exactly the same.
The browser doesn't know the difference when it recieves the
info.
-Greg
--
===============================================================
Greg Hassan, The Independent Solution (CGI,Java,SQL,Perl...)
http://www.hassan.com/, 1-607-225-4214
===============================================================
Online Editable Database: http://www.hassan.com/super_dbedit/
Form's Submissions Tracker: http://www.hassan.com/form/
Sell Stuff on the Web: http://www.hassan.com/shopcart/
===============================================================
------------------------------
Date: Fri, 28 Nov 1997 01:41:40 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: sytem command test
Message-Id: <comdog-ya02408000R2811970141400001@news.panix.com>
In article <Pine.GSO.3.96.971127101615.6576E-100000@usertest.teleport.com>, Tom Phoenix <rootbeer@teleport.com> wrote:
>On Wed, 26 Nov 1997, brian d foy wrote:
>
>> $status = system '/bin/pwd', '> /tmp/pwd';
>
>I don't think that does what you might think it does. :-)
that's what i get for posting crap that i didn't test...
$status = system '/bin/pwd > /tmp/pwd';
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Fri, 28 Nov 1997 15:00:46 +1100
From: Jaime Metcher <metcher@no.junk.mail>
Subject: Re: Trying to copy a file on winnt in perl...
Message-Id: <347E41EE.A22FA211@no.junk.mail>
This may be reprehensibly low-tech (and non-portable) of me, but in the
spirit of social engineering:
`copy file1 file2`; # Not forgetting to double-backslash any path
separators
Jaime Metcher
Douglas Nichols wrote:
>
> This seems silly but I'm not finding a command to copy a file from one
> place to the next. I could just read it but I'd rather have someother
> routine do the dirty.
>
> If you know would you direct me?
>
> thanks
>
> dn
>
> Douglas Nichols dnichols@fhcrc.org
> ----------------------------------------------------------------------------
> Database Manager National Wilms Tumor Study Group
> Fred Hutchinson Cancer Research Center
------------------------------
Date: Fri, 28 Nov 1997 08:41:31 +0100
From: "Mathias-H. Weber" <mweber@atlas.de>
Subject: Re: undump
Message-Id: <347E75AB.414BF7B6@atlas.de>
indy wrote:
>
> Excuse me,
>
Never mind.
> but finally I've found it on my own.
>
> Thanks.
>
> Indy
>
Thank you, that you give everbody else the chance also to search for the code.
This is just what the newsgroups were made for.
If you can afford it, post the source where you found the code. Maybe others are
also interested.
Mathias
--
__________________________________________________________________
| Dr. Mathias-H. Weber --- mailto:mweber@atlas.de |
| STN ATLAS ELEKTRONIK GmbH {~@_@~} |
| Brueggeweg 54 / Dept ETS21 _( Y )_ Phone: +49 421 457 4401 |
| 28305 BREMEN (:_~*~_:) Fax : +49 421 457 3177 |
| Germany (_)-(_) Telex: 2 457 460 |
___________________________SIGSIG: Signature too long (core dumped)
------------------------------
Date: 27 Nov 1997 19:52:24 -0600
From: tyde@medtrodnet.cdom (Tye McQueen)
Subject: Re: Winnt and Unix Communication
Message-Id: <65l84o$k3k@fiinix.metronet.com>
"Keith Chern" <ljchern@singnet.com.sg> writes:
) Anybody know how perl in an Unix system could trigger an NT/Win95 on the
) same network of IP protocol to run an executable or WinPerl on the NT/Win95
) to run a script? Is it by using socket communication?
) Unix and Unix communication can easily automate the trigger by automate a
) telnet login and execute on the telnet services right? Whereas Unix and
) WinNT/Win95 is another story.
There are several "remote command" thingies on the NT Resource Kit
CD. All of them are only "best-effort supported" (MicroSoft's
term) and of "beta quaility" (my assessment). If you get the rsh
daemon to work on a particular machine, then it may be a good
solution for you. If it doesn't work, it could be the typical
difficulty of getting .rhosts and related items set up properly or
it could be the bug in the rshd that prevents it from working on
half of the machines I tried (MicroSoft confirms this bug and that
they can't reproduce it). The telnetd will crash if you ever
disconnect from it imperfectly. I've had the best luck with
"rcmd", but you'd have to write a Unix client for it so that
probably isn't a good solution for you.
You can also configure Kermit95 to listen for incoming network
connections and use a Unix Kermit to run commands remotely.
You can also write something (in Perl, even) to listen on a
certain port and have it runs commands for you.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
Remove d's from address to reply (sorry for the inconvenience).
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 1384
**************************************