[12910] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 320 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 31 05:07:18 1999

Date: Sat, 31 Jul 1999 02:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 31 Jul 1999     Volume: 9 Number: 320

Today's topics:
    Re: ANNOUNCE: Perl Conference papers <uri@sysarch.com>
    Re: big Oh of sort() func (Abigail)
    Re: CGI.pm Example <uri@sysarch.com>
    Re: clearing an already-open file (Larry Rosler)
    Re: ebcdic packed numbers (Bart Lateur)
    Re: flock me! (Abigail)
    Re: framekeeper.pl <gellyfish@gellyfish.com>
    Re: How is perl braindamaged? (was Re: Is LISP dying?) (Abigail)
    Re: How to compare two files and get the differences ? (Abigail)
    Re: How to determine a date in the past (elephant)
    Re: How to read the submit button as a name or value (Eric Bohlman)
    Re: How to read the submit button as a name or value <gellyfish@gellyfish.com>
    Re: How to read the submit button as a name or value (Bart Lateur)
    Re: Net::SNMP unabel to $session->get_table <john@hendigital.com.au>
        newbie - monitor directory <ssd@bc.sympatico.ca>
    Re: newbie - monitor directory <zigouras@mail.med.upenn.edu>
    Re: perl IP to OS mapping help <gellyfish@gellyfish.com>
    Re: print with an inline " (Abigail)
    Re: when writing to data file, last letter is missing (Tad McClellan)
        Write to file!!! Need help!!! <vitrvv@yesic.com>
    Re: Write to file!!! Need help!!! (Larry Rosler)
    Re: Write to file!!! Need help!!! (Mike G.)
    Re: Write to file!!! Need help!!! <uri@sysarch.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 30 Jul 1999 23:31:36 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: ANNOUNCE: Perl Conference papers
Message-Id: <x73dy5o5pj.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLIX September
  A> MCMXCIII in <URL:news:37a224c3@cs.colorado.edu>:
  A> () The refereed papers for the upcoming Perl Conference are talked about
  A> () here:
  A> () 
  A> ()     http://www.perl.com/pub/n/Papers_Selected_for_Perl_Conference_3.0
  A> () 
  A> () and listed here:
  A> () 
  A> ()     http://conference.oreilly.com/perl3/conf_desc.html#papers


  A> Oh goodie. Now I can go off and sulk even more about the fact that I'm
  A> not coming to TPC.

larry rosler's and my paper on sorting in at:

http://www.hpl.hp.com/personal/Larry_Rosler/sort/

and the web is free, even though it is broken by your standards, so you
can afford to read the paper.

next year, save up for a vacation!

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 31 Jul 1999 00:39:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: big Oh of sort() func
Message-Id: <slrn7q52vv.hnn.abigail@alexandra.delanet.com>

Larry Rosler (lr@hpl.hp.com) wrote on MMCLX September MCMXCIII in
<URL:news:MPG.120bfed59340007b989d80@nntp.hpl.hp.com>:
** [Posted and a courtesy copy sent.]
** 
** In article <37a25104.62031247@news.inet.co.th> on Sat, 31 Jul 1999 
** 01:30:34 GMT, Ryan Ngi <ryanngi@hotmail.com> says...
** > what kind of sort is sort() function ? (selection sort, quick sort !?)
** 
** quicksort
** 
** > if the input List is a kind of Large will it very slow !?
** 
** Yes, for some values of 'kind of' and 'very'.
** 
** > what's Big-Oh of sort()?
** 
** O(N logN)


It's O (N log N) expected time, if the elements have a uniform distribution.

It's Theta (N^2) worst case time.



Abigail
-- 
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 30 Jul 1999 23:33:47 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: CGI.pm Example
Message-Id: <x7zp0dmr1g.fsf@home.sysarch.com>

>>>>> "GH" == GEOFFREY HALLIWELL <GEOFFREY.HALLIWELL@Sun.COM> writes:

  GH> This is a multi-part message in MIME format.

mime is not enjoyed on usenet and in this group in particular.


  GH> I'm trying to run one of Lincoln Stein's examples
  GH> (see attachment) and it won't allow me to view or 

  GH> IyEvdXNyL2xvY2FsL2Jpbi9wZXJsCiMgZ3Vlc3Rib29rLnBsCgokfCA9IDE7CnVzZSBDR0kg
  GH> cXcvOnN0YW5kYXJkIDpodG1sMyA6bmV0c2NhcGUgLzsKdXNlIFBPU0lYOwoKQFJFUVVJUkVE
  GH> ID0gcXcvbmFtZSBlLW1haWwvOwpAT1BUSU9OQUwgPSBxdy9sb2NhdGlvbiBjb21tZW50cy87
  GH> CiRUSU1FT1VUID0gMTA7ICAjIGFsbG93IHVwIHRvIDEwIHNlY29uZHMgZm9yIHdhaXRpbmcg

sorry, that code is illegal in perl. 

post your real code next time.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Fri, 30 Jul 1999 21:43:38 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: clearing an already-open file
Message-Id: <MPG.120c1ed320314f32989d83@nntp.hpl.hp.com>

In article <fred222-ya023580003007992238530001@news.bellatlantic.net> on 
Sat, 31 Jul 1999 02:41:36 GMT, George <fred222@mauimail.com> says...
> Silly little newbie question for the perl folk who know more than I.. when
> I have a database file open, read/write, and I'm deleting a line.. I split
> it to death, remove the line, then join the results to form a writeable
> string that I want to make the file be.  My problem is the following: If I
> just seek(DAT,0,0) and print the string, there seems to be bits from the
> original left over (since my new string is shorter than the old one, as
> I've deleted a line, the overlap from the old database remains at the end). 
> How can I clear the existing data?  I don't really want to close the file,
> unlink it and make a new file because that would be quite ugly.. I tried
> guessing at ways, ie <DAT> = "$newstring" but that didn't seem to work.

perldoc -f truncate
 
> I would appreciate greatly any help, and if replies could be emailed to me
> also at the following address without the NOTSPAM that would be damn cool:
> yurtle@bellatlantic.netNOTSPAM

It would be cooler if you had set that in your Reply-To header, without 
the NOTSPAM.  Sorry, I'm too lazy to do what you should have done 
yourself.

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


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

Date: Sat, 31 Jul 1999 08:33:45 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: ebcdic packed numbers
Message-Id: <37a5b157.2433067@news.skynet.be>

Tom Christiansen wrote:

>Yes, but my point was that there are a lot of other numbers than that,
>both rationals and irrationals.
>
>Perhaps I am just on a tangent.

But you can, at least, represent rationals by a ratio of two bignums? If
you can't, they're no rationals.

	Bart.


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

Date: 31 Jul 1999 00:38:32 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: flock me!
Message-Id: <slrn7q52to.hnn.abigail@alexandra.delanet.com>

Warren Bell (warish@concentric.net) wrote on MMCLX September MCMXCIII in
<URL:news:7ntmka$moi@chronicle.concentric.net>:
[] open(FILE, "/file.txt");
[] flock(FILE,2) || print "cannot lock file $!\n";
[] flock(FILE,8) || print "cannot unlock file $!\n";
[] close(FILE);
[] 
[] 
[] The above code prints me:
[] 
[] cannot lock file Bad file number
[] 
[] What does "Bad file number" mean?


What's the return value of your open?



Abigail
-- 
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} #  Yet Another silly JAPH by Abigail
sub A::FETCH     {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 30 Jul 1999 20:09:37 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: framekeeper.pl
Message-Id: <7nt0q1$14r$1@gellyfish.btinternet.com>

On Fri, 30 Jul 1999 11:13:10 -0700 David Cassell wrote:
> Benjamin Dälken wrote:
>> 
>> does anyone now where i can get the script "framekeeper.pl" ?
>> 
>> this is a script which takes you in the right frameset, when you only load
>> one frame of the set.
> 
> I think you'll probably want to use some web search engine
> to track it down.  

He'll love the hit he gets when he sticks 'framemaker.pl' into Altavista
;-}

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 31 Jul 1999 01:01:39 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How is perl braindamaged? (was Re: Is LISP dying?)
Message-Id: <slrn7q5492.hnn.abigail@alexandra.delanet.com>

Reini Urban (rurban@xarch.tu-graz.ac.at) wrote on MMCLIX September
MCMXCIII in <URL:news:37a20039.123452375@judy.x-ray.local>:
:: if anyone is interested in "language wars" or let's say some arguments
:: from the outside morons, we collected some arguments on comp.lang.lisp
:: "why perl is braindamaged", "why python is better", "why perl is better
:: than python", why lisp is better than everything and such.

Do you really want to do this? We've been over this so many times...

What is 'better' or not highly depends on the person and the task on
hand. There isn't a language that's the best for everyone, or the best
of a task - unless perhaps if you have a very specific task, and there's
only one dedicated language written for it.

:: * forces unreadability (obscurity) in optimizations 

It doesn't force anything. If you don't want to use a certain construct,
don't. In general, Perl gives you more ways to do it.

::   (e.g. "schwartzian transform")
::   http://www.perl.com/CPAN/doc/manual/html/pod/perldsc.html
::   or http://www.perl.com/CPAN/doc/manual/html/pod/perllol.html
::   though this is nice for c kinda folks to make them feel brave 
::   and clever, which is an important positive motivation, it makes it
::   impossible to maintain and it doesn't scale.

Odd. I would have thought that a ST would scare away C people, and
be liked by more Lispish people. And I have no idea where you base
the "impossible to maintain" and "it doesn't scale" on.

:: * arrays can hold only scalars, so you have to use references and
::   anonymous arrays, hashes.

And? Even if an array can hold an array, the inner array still takes
a single place - and hence, is a scalar.

:: * references have a impossible to learn/keep syntax.

That only says something about your abilities to learn.

::   i still don't know how to dereference right.
::   so complex data structures are not only hard to build, 
::   remembering the syntax for "(" "[" or "{" initializers, 
::   they are also hard to read.

They might look strange to the novice. But once you've learned it,
it's actually quite simple.

:: * the object system feels like a hack or later addon. 

I agree with that.

::   i almost looks like a microsoft language.
::   the syntax is unreadable, a macro system is really missing
::   here.

I don't think the syntax is unreadable. I agree that a better design
would have saved some punctuation chars, but that isn't the difference
between readable and unreadable. If you know Perl, and if you know
how its OO is implemented, the syntax is natural.

:: (note added later: a macro system wouldn't help anything. this was to
:: lisp centric. the problem is elsewhere.)
:: 
:: * the module system is overly complicated. people should be forced to
::   write modules but only 2% (the top guns) actually do.

Odd. I think modules are *easy* in Perl. Easier than say, libraries in C.

:: but on the other hand it has some nice lisp'ish features which made me
:: fall in love with perl. eval, closures, slices, world's best regex,
:: hashes, fast string processing, multiple namespaces per variable, easy
:: FFI, automatic type coercion, which could remind one to the broken
:: coercions in visual basic, but perl's is really okay.

Do you realize that the points you mark as negative might actually
help in getting those nice features you like?




Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 31 Jul 1999 01:02:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to compare two files and get the differences ?
Message-Id: <slrn7q54bc.hnn.abigail@alexandra.delanet.com>

Yeong Mo/Director Hana co. (factory@factory.co.kr) wrote on MMCLIX
September MCMXCIII in <URL:news:7ntb8i$igf$1@news1.kornet.net>:
--
-- There are lines at aaa.txt and bbb.txt as following;
-- ($f1, $category, $f2, $f3, $f4, $f5, $f6, $f7) = split ('\|', $lines);
--
-- If aaa.txt has $category=123, and bbb.txt doesn't have $category=123,
-- How can I compare two files and get the value of 123 ?


I don't understand the question. It seems to me you already have the
value 123.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sat, 31 Jul 1999 15:38:56 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: How to determine a date in the past
Message-Id: <MPG.120d36fbf6eaac05989ba8@news-server>

Eric The Read writes ..
>e-lephant@b-igpond.com (elephant) writes:
>> guaranteed that the author of Date::Manip would disagree .. as would most 
>> people .. you should read the Date::Manip documentation - particularly 
>> the section entitled "SHOULD I USE DATE::MANIP" .. because subtracting a 
>> known number of seconds from the current day falls well and truly in the 
>> 90% of the time when Date::Manip should be avoided
>
>Um... where did I say *anything* about subtracting a known number of
>seconds?  The poster wanted to subtract a number of *days* (not seconds)
>from a given date, which is exactly the sort of thing described in the
>readme for Date::Manip.

you are right .. the poster did ask for the ability to count back a 
certain number of days .. for most applications the amounts to the same 
thing as being able to count back a certain number of seconds

>I quote:
>
>   Among other things, Date::Manip allow you to:
>   ...
>   5.  Add a time offset to a date to get a second date (i.e. determine
>       the date 132 days ago or 2 years and 3 months after Jan 2, 1992)

but .. if you want a more robust solution then your choice STILL 
shouldn't be the extremely slow Date::Manip .. you seem to be so keen to 
point out the author's comments in the documentation .. so perhaps you 
should have read further to...

"                              The TimeDate and Time-
modules modules are written in perl.  The Date::Calc
module is written in C. Between these three, most of your
common date operations can be done."

>Please try and pay more attention next time, eh.

you're right - I should have included the caveat that I've now provided 
concerning the more robust solution .. my omission there doesn't make the 
Date::Manip module any more appropriate for this task

-- 
 jason - remove all hyphens for email reply -


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

Date: 31 Jul 1999 05:43:18 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: How to read the submit button as a name or value
Message-Id: <7nu2dm$ota@dfw-ixnews11.ix.netcom.com>

Abigail (abigail@delanet.com) wrote:
: My PoV is that people who have problems enough with writing simple
: programs correctly shouldn't be concerced about the overhead of a
: module. By the time the extra overhead of a module takes more than the
: extra time you spend writing the program, you're already dead, buried,
: and forgotten.

Or as Kernighan and Plauger put it in _The Elements of Programming 
Style_, "make it right before you make it faster."



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

Date: 30 Jul 1999 20:56:04 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to read the submit button as a name or value
Message-Id: <7nt3h4$153$1@gellyfish.btinternet.com>

On Fri, 30 Jul 1999 18:26:51 GMT Floyd Morrissette wrote:
> In article <37a19b21@cs.colorado.edu>,
>   tchrist@mox.perl.com (Tom Christiansen) wrote:
> 
>> Never do form-cracking by hand.  People who've written their own web
>> browsers and the author of CGI.pm are exempt, but the rest of you,
>
> I have a question. Its seems to me that it would be better, if all you
> want to do is read and parse, to cut and paste the ReadParse sub from
> CGI.pm to the script where you want to use it. 

Fine.  Just go ahead and try it ... 

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 31 Jul 1999 08:40:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to read the submit button as a name or value
Message-Id: <37a7b546.3439787@news.skynet.be>

Tom Christiansen wrote:

>2) It's slower.  You're not defining "without the cruft" as *slower*,
>   now are you? :-)
>
>    % time perl -MCGI::Request -e 1
>    0.290u 0.040s 0:00.37 89.1%     
>
>    % time perl -MCGI -e 1
>    0.140u 0.020s 0:00.20 80.0%     

Could it be CGI's trick of using AUTOLOAD? Then, the compile time you
timed above is not the complete compile time, but only a *very small
fraction*, because you didn't try to use any additional functionality.
If you need to invoke that AUTLOAD mechanism a lot, and I assume it will
happen as soon as you do *anything*, it will slow things down quite a
bit.

CGI::REquet, OTOH, doesn't depend on AUTOLOAD.

	Bart.


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

Date: 31 Jul 1999 11:08:40 -0800
From: "John Hennessy" <john@hendigital.com.au>
Subject: Re: Net::SNMP unabel to $session->get_table
Message-Id: <01bedb01$86362c20$f34f39cb@stingray>

Anyone familiar with Net::SNMP would recognise this code lifted straight
out of the Net::SNMP perldoc.
The get_table method has no accoumpiang examples...

$response = $session->get_table($oid);

There is reference in the perldoc to $response containing a hash reference.
I am unsure how to use this hash reference to return the data I want.

If I do the following...

foreach $oid(keys %$response)
        {
        print "$response\n";
        }

I get... 

1.3.6.1.4.1.529.11.16.1.13.301564891
1.3.6.1.4.1.529.11.16.1.13.301564892
1.3.6.1.4.1.529.11.16.1.13.301564893

This is part of what I want but I need to be able to access the rest of the
values in the returned table.

Complete semi working code...

#!/usr/local/bin/perl -w

use Net::SNMP;

$hostname = '192.168.0.1';
$community = 'public';
$port = '161';
$seconds = '10';
$count = '3';

$oid = '1.3.6.1.4.1.529.11.16.1.13';

($session, $error) = Net::SNMP->session(Hostname  => $hostname,
                                        Community => $community,
                                        Port      => $port,
                                        Timeout   => $seconds,
                                        Retries   => $count);

if (!defined($session))
        {
        printf("ERROR: %s\n", $error);
        exit 1;
        }


$response = $session->get_table($oid);

$session->close;

foreach $oid(keys %$response)
        {
        print "$response\n";
        }

HC <carvdawg@patriot.net> wrote in article
<37A210B7.DC233A9@patriot.net>...
> How about posting the code you are using...for all we know, you may be
> trying to get a table where there is none!
> 
> John Hennessy wrote:
> 
> > I have read through the documentation that comes with Net::SNMP version
2.0
> > but am still unable to get the "get_table" function to return any data.
> >
> > Where can I find some sample code or additional documentation to help ?
> >
> > Thanks
> 
> 


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

Date: Fri, 30 Jul 1999 22:00:33 -0700
From: "Steve S" <ssd@bc.sympatico.ca>
Subject: newbie - monitor directory
Message-Id: <Tfvo3.153$nK2.470918@news.bctel.net>

Does anybody have an existing script or and idea of how you would structure
one to monitor a directory for new files, and if a new file is detected then
issue an alert box?

Any help would be appreciated,

Regards,
Steve.




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

Date: Sat, 31 Jul 1999 01:55:42 -0400
From: Nico Zigouras <zigouras@mail.med.upenn.edu>
To: Steve S <ssd@bc.sympatico.ca>
Subject: Re: newbie - monitor directory
Message-Id: <37A28FDE.AC322BA9@mail.med.upenn.edu>

Why not store the list of files in the directory in a txt file and then compare
against that txt file to see if it has changed.  As to  issuing an alert, I am
not sure where you want this to appear.  On a web page?  Send the ouptut of the
script to CGI to a Javascript.  Here is a snippet of code to do the Perl stuff.

## This stores the file list.
## Note the back quotes here.
@file_list = `ls /your/directory/of/interest/`;
open( F, ">/file/to/log/list.txt" );
foreach $file ( @file_list ) {
  print F "$f \s";
}
close( F );

## Then. later when you want to check if a file has been added.
@new_file_list = `ls /your/directory/of/interest/`;
open( RF, "/file/to/log/list.txt" );
while( <RF> ) {
  @old_list = split(/\s/, $_);
}
close( RF );

## Put old list into a hash.
foreach $l ( @old_list ) {
  $old_listHash{$l} = 1;
}

## Check if each of the new ones exists in the old one
foreach $new_file ( @new_file_list ) {
  if ( !exists( $old_listHash{$new_file} ) ) {
    push( @the_new_ones, $new_file );
  }
}

## Now you have an array of new files @the_new_ones
## Print it out of you want.

print"These are the new files:\n";
foreach $nf ( @the_new_ones ) {
  print"$nf\n";
}

## You also would want to log the current list to run this script again in the
future.
## end

Steve S wrote:

> Does anybody have an existing script or and idea of how you would structure
> one to monitor a directory for new files, and if a new file is detected then
> issue an alert box?
>
> Any help would be appreciated,
>
> Regards,
> Steve.



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

Date: 30 Jul 1999 20:30:35 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl IP to OS mapping help
Message-Id: <7nt21b$14v$1@gellyfish.btinternet.com>

On Fri, 30 Jul 1999 11:34:09 -0700 David Cassell wrote:
> Malcolm Ray wrote:
>> 
>> On Fri, 30 Jul 1999 15:19:36 GMT, ffr200 <ffr200@my-deja.com> wrote:
>> >hello,
>> >  I need to write a perl program that receives an IP address and a
>> >hostname, and is able to return an operating system and OS
>> >information.  
>> 
>> If the IP address is within your own organisation, then just ask the
>> person responsible for that host (you do keep track of ownership of
>> IP addresses, right?).  If the IP address is outside your organisation,
>> then it's none of your business what OS is running on that host.
> 
> Yep.  And if the given IP address is a firewall or a proxy
> or the ISP of the user, then the available info [even via nmap]
> may not be what the poster wanted.
> 
> Why would anyone need the OS from a given IP?
> 

You really always have worn a white hat havent you ;-}

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 31 Jul 1999 00:43:33 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: print with an inline "
Message-Id: <slrn7q5376.hnn.abigail@alexandra.delanet.com>

Tom Beauchamp (acafounder@crosswinds.net) wrote on MMCLX September
MCMXCIII in <URL:news:7ntkma$km6@nnrp1.farm.idt.net>:
// What would the print statement be to print this line:
// 
// <font face="Arial, Helvetica, sans-serif">Arial</font>
// 
// I can't figure out how to print the inline quotation marks.


$" = '"';
my @chunks = ("<font face=", "Arial, Helvetica, sans-serif", ">Arial</font>");
print qq $@chunks$;



Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 30 Jul 1999 15:38:35 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: when writing to data file, last letter is missing
Message-Id: <rvusn7.opt.ln@magna.metronet.com>

vmacri@my-deja.com wrote:

: This may be a little vague but,


   So why be vague?

   Can a mechanic fix your car without seeing your car?

   Can a doctor fix you withou examining you?

   Can a programmer fix a program without seeing the code?



: I am totally lost, can anyone help....Please!!!


   You have an error on line 17.


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


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

Date: Fri, 30 Jul 1999 23:07:30 +0400
From: "Andrei" <vitrvv@yesic.com>
Subject: Write to file!!! Need help!!!
Message-Id: <lKto3.114$LF6.10321@news2.randori.com>

If i have a file (f1.txt) which contains strings ended with (\n), and I need
to create same file. I am using the code
open (f,"<$f1");
@dbc=<f>;
close(f);

open (f,">$f2");
print (f "@dbc");
close(f);

But in the new file all the lines except #1 starts from ( )(space)

How can i delete this space or where is my problem?


--
--------------------------------------------------------------------------
Andrei
E-mail: andrv@yesic.com
Visit my Web Site at http://www.lavasoft.cjb.net






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

Date: Fri, 30 Jul 1999 21:35:19 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Write to file!!! Need help!!!
Message-Id: <MPG.120c1cdbc20ffe15989d82@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <lKto3.114$LF6.10321@news2.randori.com> on Fri, 30 Jul 1999 
23:07:30 +0400, Andrei <vitrvv@yesic.com> says...
> If i have a file (f1.txt) which contains strings ended with (\n), and I need
> to create same file. I am using the code
> open (f,"<$f1");
> @dbc=<f>;
> close(f);
> 
> open (f,">$f2");
> print (f "@dbc");
> close(f);
> 
> But in the new file all the lines except #1 starts from ( )(space)
> 
> How can i delete this space or where is my problem?

perlfaq5: "Why do I get weird spaces when I print an array of lines?"

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


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

Date: 31 Jul 1999 04:45:12 GMT
From: tcsh@holly.colostate.edu (Mike G.)
Subject: Re: Write to file!!! Need help!!!
Message-Id: <slrn7q504n.8t1.tcsh@localhost.localdomain>

vitrvv@yesic.com (Andrei):
> But in the new file all the lines except #1 starts from ( )(space)

The default list seperator is a space.  Undefine it,

undef $";

--
Mike Grandin


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

Date: 31 Jul 1999 01:17:02 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Write to file!!! Need help!!!
Message-Id: <x7vhb1mm9d.fsf@home.sysarch.com>

>>>>> "MG" == Mike G <tcsh@holly.colostate.edu> writes:

  MG> vitrvv@yesic.com (Andrei):
  >> But in the new file all the lines except #1 starts from ( )(space)

  MG> The default list seperator is a space.  Undefine it,

  MG> undef $";

i wasn't going to followup here but that is a stupid answer. he put his
array in a quoted string which was the mistake. don't compound it by not
telling him that and making him go down a dark path. rarely does $" need
to be used. and setting it to undef will cause warnings under -w. you do
use -w don't you? and what if he forgets to reset it to space later in
the program and wants the default behavior of array interpolation? so
you should have told him to localize $" as well.

better off just saying to him to drop the quotes around "@array" when he
is printing it.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 320
*************************************


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