[11083] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4683 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 18 20:05:03 1999

Date: Mon, 18 Jan 99 17:00:18 -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           Mon, 18 Jan 1999     Volume: 8 Number: 4683

Today's topics:
    Re: ActiveX or Java for E-Commerce Applications <ijp@thornlea.force9.co.uk>
    Re: Calculate next [mon..sun]day (Steve Lamb)
    Re: custom counter question (sorry if duplicated) (Ian Porteous)
    Re: custom counter question (sorry if duplicated) <jdf@pobox.com>
    Re: Help: Advanced Search and Replace Question (Martien Verbruggen)
    Re: HELP: Netscape 4.5 doesn't like text/html header fr jayceh@my-dejanews.com
    Re: How to get IP address of a local machine under NT <kperrier@blkbox.com>
        interesting database project slamnet@my-dejanews.com
        Lame coding question <gavin@optus.net.au.dontspam.myass>
        launching perl scripts from windows explorer <rsr@rogerware.com>
    Re: Looking for CGI modules (Mick Farmer)
        modem access crazychop@my-dejanews.com
        Newbie Question <nathan.owen@isocor.com>
    Re: Newbie Question (Alastair)
        Order form/Credit Cards <hitbyabus@mindspring.com>
    Re: Perl Criticism (Richard Clamp)
    Re: Perl Web browser problem <dgris@moiraine.dimensional.com>
    Re: Perl Web browser problem <ijp@thornlea.force9.co.uk>
    Re: Perl Web browser problem <ijp@thornlea.force9.co.uk>
        port scanning <cheezz@rhein.to>
    Re: port scanning <spam@dikkelul.com>
    Re: port scanning <jdf@pobox.com>
    Re: Printing word betrween to patterns - Sorry New (Tad McClellan)
    Re: rpm 5.005_?? ? <squid@panix.com>
    Re: Set current position in a file (Mick Farmer)
    Re: splitting file using eof question <hamptonk@bible.org>
    Re: The number of seconds since 1/1/1970 ? (Mick Farmer)
        Using PERL to access SQL <sme@planetpod.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 18 Jan 1999 22:12:32 -0000
From: "Ian" <ijp@thornlea.force9.co.uk>
Subject: Re: ActiveX or Java for E-Commerce Applications
Message-Id: <zmOo2.7816$dh1.1818@wards>

>The questionaire is available at
>http:\\ganymede.kst.dit.ie\arkiernan\questionaire\index.asp

the slashes go the other way  ;)

arkiernan@maths1.kst.dit.ie wrote in message
<77vk8a$pva$1@nnrp1.dejanews.com>...
>I am a final BSc. computer science, my final year thesis is a
>comparison of ActiveX and Java for the development of E-Commerce
>applications.
>
>As part of this thesis I am surveying the opinion of
>E-Commerce developers on the abilities of ActiveX and Java
>as a means of developng E-Commerce applications.
>
>As a perl user myself and find it to be a successful means of developing
web
>applcations, I am particukarly interested in the opinions of perl users in
>this aspect.
>
>As such, I would be extremely grateful if anyone out there
>would taks the time ( 5 minutes aprox, depending on the detail
> of your comments) to answer a small questionaire.
>
>The questionaire is available at
>http:\\ganymede.kst.dit.ie\arkiernan\questionaire\index.asp
>
>My results will be taken a sum of all the reponses, so no
>direct persons or comments wil be refered to or implied upon
>in my thesis.
>
>I greatly appreciate the time anyone takes to participate in this survey.
>Thanking you in advanced,
>Alan Kiernan
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: 18 Jan 1999 14:43:58 +0800
From: morpheus@no-spam.calweb.com (Steve Lamb)
Subject: Re: Calculate next [mon..sun]day
Message-Id: <slrn7a7e9d.5mg.morpheus@rpglink.com>

On Mon, 18 Jan 1999 17:02:24 GMT, marcel_anthonijsz@my-dejanews.com
<marcel_anthonijsz@my-dejanews.com> wrote:
>I want to calculate the date of next [mon..sun]day, what is the easiest and
>most nice way to do this? It should work after the year 0 .. (Hey, my brain
>has a Y2K bug!).

$newtime = time + 604800;
@time = localtime($newtime);
$time[4] += 1;
print("$time[4]+1/$time[3]/$time[5]\n");

eg:
{morpheus@web1;0.40:/s1/morpheus}date ; perl blah
Mon Jan 18 14:43:06 PST 1999
1/25/99

-- 
             Steve C. Lamb             | Opinions expressed by me are not my
    http://www.calweb.com/~morpheus    | employer's.  They hired me for my
             ICQ: 5107343              | skills and labor, not my opinions!
---------------------------------------+-------------------------------------


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

Date: Mon, 18 Jan 1999 22:52:11 -0000
From: Ian@thornlea.force9.co.uk (Ian Porteous)
Subject: Re: custom counter question (sorry if duplicated)
Message-Id: <MPG.110dcb7172910128989687@usenet.force9.net>

In article <36A279AA.A3417037@ngb.se>, staffan@ngb.se says...
> $/ = undef;
> 

what does that bit do?


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

Date: 18 Jan 1999 23:56:44 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: Ian@thornlea.force9.co.uk (Ian Porteous)
Subject: Re: custom counter question (sorry if duplicated)
Message-Id: <m3zp7g2nrn.fsf@joshua.panix.com>

Ian@thornlea.force9.co.uk (Ian Porteous) writes:

> In article <36A279AA.A3417037@ngb.se>, staffan@ngb.se says...
> > $/ = undef;
> > 
> 
> what does that bit do?

Check out the perlvar document, which explains the meaning and use of
$/ (aka $INPUT_RECORD_SEPARATOR).

   $ perldoc perlvar

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Mon, 18 Jan 1999 22:04:56 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help: Advanced Search and Replace Question
Message-Id: <ceOo2.20$U41.2927@nsw.nnrp.telstra.net>

In article <780abt$ecm$1@news-1.news.gte.net>,
	Brook Harty <harty@gte.com> writes:
> I want to remove all html tags from a document.

Advanced?

> tags are anything between <> tags. example <foobar>

Thanks for telling us.

> s/whatgoeshere?//;
> 
> <*> would be nice, but is not the right syntax.

Nope, it isn't. In fact, the right answer to this question is in the
perl FAQ list.

# perldoc perlfaq9
/     How do I remove HTML from a string?

The perl faq and all other perl docuemntation comes with your perl
installation. Please, use it. Give each section in the faq at least a
cursory glance, but better, a thorough read.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.       | cynical. It's perfectly easy to be
NSW, Australia                      | cynical.


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

Date: Mon, 18 Jan 1999 21:39:11 GMT
From: jayceh@my-dejanews.com
Subject: Re: HELP: Netscape 4.5 doesn't like text/html header from Perl script
Message-Id: <7809lt$dq1$1@nnrp1.dejanews.com>

The header part is more for the web server than the browser.  check more
around that code.. In article <77t6r8$qgo$1@nnrp1.dejanews.com>, 
cndawes@my-dejanews.com wrote:

> I have written a perl script, which outputs some HTML. It does this very
> nicely with IE4, however, when I use Netscape 4.5 it is as though it is
> completely ignoring the "Content-type: text/html\n\n" which I am sending it,
> as it prints the source to the screen, HTML tags and all.
>
> Anyone got any clues as to why this could be the case, as I am completely
> stuck.
>
> Thanks in advance for any help.
>
> Charles Dawes.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 18 Jan 1999 16:10:14 -0600
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: How to get IP address of a local machine under NT
Message-Id: <ysizp7gqlkp.fsf@blkbox.com>

Igor Proskuriakov <IProskuriakov@mfkren.com> writes:

> Hi, there!
> Could you please tell me how I can get an IP address of a local computer
> running Windows NT, assuming that it has only one network card.
> 

I would right-click on the network neighborhood icon and select properties.
Then I would check the TCPIP properties to get the ipaddress if the machine.

What this has to do with perl I don't know.

Kent


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

Date: Mon, 18 Jan 1999 21:51:16 GMT
From: slamnet@my-dejanews.com
Subject: interesting database project
Message-Id: <780acg$ef5$1@nnrp1.dejanews.com>

Use me as your guinea pig...

I'm looking for a programmer that wants to showcase their abilities (desc
below) .  I don't have a lot of money, but I have an interesting project for
someone that wants to get some notoriety for their work.  If you know of
someone who would be interested in next-to-free work in exchange for
something to demonstrate their abilities to prospects, please forward this to
them.  I can pay, but not much - this is my personal site.  Am I being naive
in thinking that someone would want to do this?  Surely someone is looking
for a real-word app to do to put on their resume.

I am the editor of a songwriting Web site called Lyrical Line at
http://www.lyricalline.com/ .  It is a free site for songwriters to post their
songs and receive feedback about them.  The database will automate the posting
of songs (for registered users) and the posting of critiques by anyone
(registered or not).

The database will replace my manual updates of songs to the site.
I am on Unix (BSD) and the system needs to be written in perl.

first element of database:
visitor will "register" - username & password
post song if they have registered
  8 - 10 fields for song record
  add, change and delete feature

second element: anyone (registered or not) can post comments (called
critiques) about a song  critique is linked from the bottom of that song and
is not linked from anywhere else

No record will be available for viewing until admin (me) goes to an admin page
and approves the records (to prevent boneheads from putting up junk records).

This database will need to be able to be sorted by a number of the fields in a
record - date, genre, name (last name).

The database will serve three sections:  Write & Wrong, SpotLite and Songs of
the Stars. Will add two more section in the near future which will need this
database. It's your call as to if we should make a separate database and
cgi's for each section or not - I think we should...but they are all
identical.  You could make one and duplicate it.  Most sections will not use
the "critique" feature...

Visit:

http://www.lyricalline.com/writeandwrong/
http://www.lyricalline.com/spotlite/
http://www.lyricalline.com/songsofthestars/

to see how the sections currently operate.  I would like the database to
operate exactly like this, unless you can think of a more efficient way of
implementing the features.  I don't have the sort feature - obviously, but
everything else should work this way.

Thanks,

Rob (datab

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 18 Jan 1999 23:10:37 GMT
From: "Gavin Cato" <gavin@optus.net.au.dontspam.myass>
Subject: Lame coding question
Message-Id: <NbPo2.3$_o.306113@news0.optus.net.au>

Hi Guys,

I come from a bash/csh world am am still teaching myself perl so go easy :-)

This script emails a upstream network provider that we have to update their
router filters ; often more than one network needs to be added at a time

I have the script working very well at the moment for single network
additions, it does the job perfectly but modifying it to handle multiple
enrties is confusing my un-perlified head. I'm including the current
original working script at the bottom of the message. You can see the point
I want to do "print" the multiple networks at the line where i say ' print
"$network $mask\n";

I want a piece of code that does this ; (roughly)

a) Prompts the user for a network to add
b) asks for the appropriate netmask
c) Stores the network and the netmask in a variable/file/whateverisbest
d) if at point A the user types "Q" the script assumes that the user has
finished adding routes and wishes them to be emailed off
e) loop back to point A to prompt for the next network
f) If q pressed, take the network entries and go to the rest of the script.

Roughly in my head;

sub promptnetwork {

print "Please enter the network to add ( Q to stop adding entries)\n";
$network = <STDIN>;
chomp $network;
if ($network eq "q") {   ## how do I make it check for a uppercase Q as well
on the same line?
&subfinishscript
}

print "Please enter the network mask for $network\n";
$netmask = <STDIN>;
chomp $netmask;

}


#### START WORKING SCRIPT HERE

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

$version = "0.01";
$destination = "update\@upstreamprovider.com";
$replyto = "gavin\@optus.net.au";
$companyname = "My company name";
$peer = "ip address";
$sendmail = "/usr/lib/sendmail";

system ("clear");

print "Mail AT&T version $version\n";

print "Please enter the RADB registered AS number\n";
        $as = <STDIN>;

print "Please enter the network to be added to AT&T's filter list\n";
        $network = <STDIN>;

print "Please enter the network mask for $network\n";
        $mask = <STDIN>;

        chomp $as;
        chomp $network;
        chomp $mask;

print "This is the email that will be sent to $destination\n";

print "\n\n";
print "-----------------------------------------------------------\n";
print "Route update as follows, from $replyto - $companyname \n\n";
print "Origin AS:\t$as\n";
print "Transit AS:\t7474\n";
print "Action:\tADD\n";
print "Route registered in:\tRADB\n";
print "Neighbour Address:\t$peer\n";
print "\n";
print "Routes:\n";
print "\n";
print "$network $mask\n";
print "-----------------------------------------------------------\n";

print "Is this OK to send to $destination for update for the net
$network?\n";
print "Choice? (Y or N)";

$choice = <STDIN>;
chomp $choice;

if ($choice eq "Y") {
        &mailatt;
}

if ($choice eq "y") {
        &mailatt;
}

if ($choice eq "yes") {
        &mailatt;
}

if ($choice eq "YES") {
        &mailatt;
}

if ($choice eq "N") {
}

if ($choice eq "n") {
}

if ($choice eq "no") {
}

if ($choice eq "NO") {
}

die "Exiting";

sub mailatt {

open MAIL, "|$sendmail -t" or die "Error opening $sendmail: $!\n";

print MAIL <<END_OF_MESSAGE;
To: $destination
cc: $replyto
From: $replyto
Subject: Route Update request
Route update as follows, from $replyto - $companyname

Origin AS:\t$as
Transit AS:\t7474
Action:\tADD
Route registered in:\tRADB
Neighbour Address:\t$peer

Routes:

$network $mask

END_OF_MESSAGE

close MAIL or die "Error closing or running $sendmail: $!\n";

print "Message sent\n";

}

thanks






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

Date: Mon, 18 Jan 1999 16:14:52 -0800
From: "Roger S Reynolds" <rsr@rogerware.com>
Subject: launching perl scripts from windows explorer
Message-Id: <V6Qo2.235$jp4.1864@news14.ispnews.com>

I know, this is probably the wrong place to ask this, but I'm hoping
somebody
out there will have done something like this before, and will be so kind as
to
clue me in on the tricks...

Say I have a perl script that does something useful to a set of files
in the current directory.

If I am in a command shell, I can execute it like so:
   cd somedirectory
   perl -S myscript.pl

Now, say that I want to launch this script from the windows explorer
somehow.
Like, I have the explorer opened to the directory I'm interested in, and
I'd like to add some sort of entry to one of the menus to invoke the script.
Seems perfectly reasonable, right!?

I have had limited success in adding new actions for a specific file type,
which are implemented by running a perl script.
But, there are two problems with that...
- The action applies to the currently selected file, I can't see how to
specify
  actions for the current folder
- I have to add the action(s)  for each and every file type separately.
  (i.e. .h and .cxx are different FileTypes, so I have to create an action
   separately for each of them)

Any ideas...

============================================================
Roger S. Reynolds
email: rsr@rogerware.com  rsr@softix.com
  Web: http://www.rogerware.com





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

Date: Mon, 18 Jan 1999 17:16:17 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: Looking for CGI modules
Message-Id: <F5rMn5.3p3@mail2.ccs.bbk.ac.uk>

Dear Tad,

Try the CGI.pm module on CPAN.

Regards,

Mick


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

Date: Mon, 18 Jan 1999 22:32:18 GMT
From: crazychop@my-dejanews.com
Subject: modem access
Message-Id: <780cpi$gjm$1@nnrp1.dejanews.com>

I am somewhat new to perl (especially on windows) and would like to know if
any knows of any perl script/code that would allow me to read in a text file
of phone/pager numbers, dial the number, leave a call back number, hang up
and so forth and so on with each subsequent number.

All I need is something simple to do this and written in perl would be even
better.  I've looked around in the modules and couldn't find anything.  If
anyone knows of anything, please let me know ...

Thanks in advance - AJ

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 18 Jan 1999 18:35:24 -0500
From: "Nathan Owen" <nathan.owen@isocor.com>
Subject: Newbie Question
Message-Id: <780gk6$r9b$1@ash.prod.itd.earthlink.net>

I have a (very) newbie question.  I am writing a Perl script in which I am
generating a statistical report.  The stats are generated by a program
outside of perl along with some options.   I use the "exec" function in perl
to fire off the process along with the options I need.  I execute the
process nine times, each time with seperate options.  What I need to know is
how do I "exec" a operating system command, and make sure the that command
has completed before the next "exec" of a operating system command fires
off?  I think I am looking for some kind of wait statement.

As it stands now Perl quickly fires off all 9 "exec"s to the operating
system and they all take significantly different amounts of time to finish.
Since I am a newbie, I am logging the results of all these system calls to a
single report file.

Thanks in advance for any help you may have.

Nathan Owen
nathan.owen@isocor.com





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

Date: Tue, 19 Jan 1999 00:32:33 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Newbie Question
Message-Id: <slrn7a7kma.59.alastair@calliope.demon.co.uk>

Nathan Owen <nathan.owen@isocor.com> wrote:
>I have a (very) newbie question.  I am writing a Perl script in which I am
>generating a statistical report.  The stats are generated by a program
>outside of perl along with some options.   I use the "exec" function in perl
>to fire off the process along with the options I need.  I execute the
>process nine times, each time with seperate options.  What I need to know is
>how do I "exec" a operating system command, and make sure the that command
>has completed before the next "exec" of a operating system command fires
>off?  I think I am looking for some kind of wait statement.

Are you sure you want to use 'exec'? It's my understanding that 'exec' never
returns. The calling process is replaced by the 'exec'd process.

Why not look at 'system' and the use backticks (``)? These will wait for the
called program to finsih and can gather output as required.

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Mon, 18 Jan 1999 18:35:50 -0500
From: "Brian Thompson" <hitbyabus@mindspring.com>
Subject: Order form/Credit Cards
Message-Id: <780gdo$qd7$1@camel25.mindspring.com>

I have an order form that is kind of like Formail, only I added the ablility
to reply to the customer, and then database the order. I am needing to add
another subroutine that sends the credit card information to authorize.net
for validation. How do I get the script to post the variables to the script
on authorize.net without the user ever knowing what is going on?

Brian Thompson,
Network Administrator
Create-a-Web Hosting & Design
www.createaweb.com




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

Date: Tue, 19 Jan 1999 00:16:54 GMT
From: richardc@tw2.com (Richard Clamp)
Subject: Re: Perl Criticism
Message-Id: <36a3ceac.123855844@news.highwayone.net>

On Mon, 18 Jan 1999 16:13:12 -0500, fl_aggie@thepentagon.com (I R A
Aggie) wrote:

>In article <i9hu77.7o4.ln@magna.metronet.com>, tadmc@metronet.com (Tad
>McClellan) wrote:
>
>+    Daffy Duck is a celebrity...
>
>Yeah, but he can't get a check cashed...

I'd proabably lend him a fiver though, photo opportunity allowing.

Richard


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

Date: 18 Jan 1999 15:14:58 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Perl Web browser problem
Message-Id: <m3u2xoz0rh.fsf@moiraine.dimensional.com>

"Ian" <ijp@thornlea.force9.co.uk> writes:

> give the guy a break, it's obvious (well to most people anyway) what he
> means, why do you have to try to be so clever, secondly if the post isn't

Give Tad a break.  It's obvious that the reason that most of us hang
out here is because we like to talk about perl.  Why do you have to
try to be clever, complaining about the subjects that we do or don't
like to discuss?

Beyond that, why is it that we (the denizens of clpm) are constantly
criticized for what we are interested in talking about?  Why do you
think that you have any position to be telling us what is and isn't
acceptable for us to talk about?  Would you walk up to a random group
of people in a restaurant and berate them because you don't like the
social conventions they use amongst themselves or because you find their
choice of conversation uninteresting?

Go away.

*plonk*

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Mon, 18 Jan 1999 22:27:56 -0000
From: "Ian" <ijp@thornlea.force9.co.uk>
Subject: Re: Perl Web browser problem
Message-Id: <%AOo2.7832$dh1.1826@wards>

case in point, taken from a post by your buddy tad: - seems to have some
repressed anger (or something)


>>   It does not merely _resemble_ source code, it _is_ source code.
>>
>>   It runs fine and produces sensible output
>>   (Usually "just another perl hacker").
>>
>>  Come back when you know what you're talking about.

so this group is your and his personal domain?,
where you're the masters of all you survey...  is that it?


Sorry if i intruded on your little power trip..

Ian

Daniel Grisinger wrote in message ...
>"Ian" <ijp@thornlea.force9.co.uk> writes:
>
>> give the guy a break, it's obvious (well to most people anyway) what he
>> means, why do you have to try to be so clever, secondly if the post isn't
>
>Give Tad a break.  It's obvious that the reason that most of us hang
>out here is because we like to talk about perl.  Why do you have to
>try to be clever, complaining about the subjects that we do or don't
>like to discuss?
>
>Beyond that, why is it that we (the denizens of clpm) are constantly
>criticized for what we are interested in talking about?  Why do you
>think that you have any position to be telling us what is and isn't
>acceptable for us to talk about?  Would you walk up to a random group
>of people in a restaurant and berate them because you don't like the
>social conventions they use amongst themselves or because you find their
>choice of conversation uninteresting?
>
>Go away.
>
>*plonk*
>
>dgris
>--
>Daniel Grisinger          dgris@moiraine.dimensional.com
>perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
>m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'




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

Date: Mon, 18 Jan 1999 22:16:25 -0000
From: "Ian" <ijp@thornlea.force9.co.uk>
Subject: Re: Perl Web browser problem
Message-Id: <cqOo2.7822$dh1.1779@wards>

>why is it that we (the denizens of clpm) are constantly
>criticized for what we are interested in talking about?

I don't think it's the subject matter of your posts that are being
criticised, moreover it's the attitude and sheer pig-headedness that is
demonstrated in the aforementioned posts.

Daniel Grisinger wrote in message ...
>"Ian" <ijp@thornlea.force9.co.uk> writes:
>
>> give the guy a break, it's obvious (well to most people anyway) what he
>> means, why do you have to try to be so clever, secondly if the post isn't
>
>Give Tad a break.  It's obvious that the reason that most of us hang
>out here is because we like to talk about perl.  Why do you have to
>try to be clever, complaining about the subjects that we do or don't
>like to discuss?
>
>Beyond that, why is it that we (the denizens of clpm) are constantly
>criticized for what we are interested in talking about?  Why do you
>think that you have any position to be telling us what is and isn't
>acceptable for us to talk about?  Would you walk up to a random group
>of people in a restaurant and berate them because you don't like the
>social conventions they use amongst themselves or because you find their
>choice of conversation uninteresting?
>
>Go away.
>
>*plonk*
>
>dgris
>--
>Daniel Grisinger          dgris@moiraine.dimensional.com
>perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
>m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'




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

Date: Mon, 18 Jan 1999 23:17:12 +0100
From: "Cheezz" <cheezz@rhein.to>
Subject: port scanning
Message-Id: <780bm5$rv9$2@usenet45.supernews.com>

Hi... can someone help me..

I would like to connect to a server with a socket and then to check the port
80 on that server...
if it is running... if it is running everything is cool if not I want an
error message....

how do i go about doing this...

i tried it with the IO::Socket but I somehow couldn't determine if the
socket worked or not...

Thanks





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

Date: Mon, 18 Jan 1999 23:38:38 +0100
From: "Willem" <spam@dikkelul.com>
Subject: Re: port scanning
Message-Id: <780dc0$b9n$1@dinkel.civ.utwente.nl>

use IO::Socket;
$addr = "dikkelul.com";
$port = "80";
$prot = "tcp";
$r = IO::Socket::INET->new(Proto=>$prot,PeerAddr=>$addr,PeerPort=>$port);
$remote ? (print "Connected!\n") : (die "Error, couldn't connect!\n");

good luck
Willem




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

Date: 18 Jan 1999 23:52:18 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: "Cheezz" <cheezz@rhein.to>
Subject: Re: port scanning
Message-Id: <m33e5842jh.fsf@joshua.panix.com>

"Cheezz" <cheezz@rhein.to> writes:

> i tried it with the IO::Socket but I somehow couldn't determine if
> the socket worked or not...

It's hard to know what/if you did wrong without seeing some source
code!

Here's something to give you an idear.

    #!/usr/bin/perl -w
    $|++;
    my @hosts = qw( localhost www.yahoo.com snork );

    use LWP::UserAgent;
    $ua = new LWP::UserAgent;

    foreach $host (@hosts) {
      $req = new HTTP::Request 'GET' => "http://$host/";
      $res = $ua->request($req);

      if ($res->is_success) {
	print "$host is up and listening at port 80\n";
	next;
      }
      my $err = $res->status_line;
      if ($err =~ /connection refused/i) {
	print "$host has nothing listening at port 80\n";
      }
      elsif ($err =~ /bad hostname/i) {
	print "can't resolve $host\n";
      }
      else { print "$err\n"; }
    }

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Mon, 18 Jan 1999 17:39:15 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Printing word betrween to patterns - Sorry New
Message-Id: <3ng087.n4c.ln@magna.metronet.com>

Scott Hadley (ssh@cheerful.com) wrote:
: Sorry for the simple - question - still trying to learn.

: What I want to do is print the word found between  $pr .... $en. I for
: the life of me can't figure out the proper syntext.

: $pr="%!";
: $en="!%";

:  if ($_ =~ /$pr/) {

   if ($_ =~ /$pr(.*?)$en/) {
      print "$1\n";



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


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

Date: 18 Jan 1999 19:38:19 -0500
From: Yeoh Yiu <squid@panix.com>
Subject: Re: rpm 5.005_?? ?
Message-Id: <oxg90f03xms.fsf@panix.com>

Pascal Rigaux <pixel_@geocities.com> writes:
> > Is there a red hat/intel rpm for a perl 5.005_??
> > 
> > http://www.redhat.com/support/linux-info/pkglist/PByName.html
> > lists only perl-5.004-6.
> > 
> 
> go to filewatcher.org, search for perl*005*i386*, you'll find :
> 
> ftp://contrib.redhat.com/libc6/i386/
> 
>   3689k 1998-08-11 i  perl-5.005_02-1.i386.rpm  ->rh c. i386 gl
> 
> Hope it helps, Pixel.

That's the fact, Jack !
thanks !

squid.


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

Date: Mon, 18 Jan 1999 17:04:49 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: Set current position in a file
Message-Id: <F5rM41.3J8@mail2.ccs.bbk.ac.uk>

Dear Giga Tron,

The function tell() returns the current file position.  This
can be used as an argument to seek() to get back there.

Regards,

Mick


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

Date: Mon, 18 Jan 1999 22:16:42 GMT
From: Hampton Keathley <hamptonk@bible.org>
Subject: Re: splitting file using eof question
Message-Id: <36A3B2BA.5404E150@bible.org>

Thanks for the prompt response.

I didn't know about the "last;" thingy, but it works.

Hampton


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

Date: Mon, 18 Jan 1999 17:15:15 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: The number of seconds since 1/1/1970 ?
Message-Id: <F5rMLF.3oH@mail2.ccs.bbk.ac.uk>

Dear Bob,

If your server allows Server-Side Includes (SSIs), then

	<!--#echo var="DATE_LOCAL"-->

will output the current date and time.  The format, etc. can
be controlled using the config SSI.

Regards,

Mick


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

Date: Mon, 18 Jan 1999 16:28:13 -0800
From: Stewart Eastham <sme@planetpod.com>
Subject: Using PERL to access SQL
Message-Id: <36A3D19D.E8F5F782@planetpod.com>

We are using  PERL to import data from a large amount of text files
(30,000 files) to a mySQL database.  Here is the method I used, but the
system bogged down (i.e. used up too much processing power, so the ISP
killed it).   Now, I need to come up with another method:

1. The script loops through all of text the files in a particular
directory
2. It reads in the "key" field from the record contained in the text
file
3. It uses a SQL select command to make sure the "key" is not already in
the database
"select firstName from DB where key='$key'"
4. If the record is not in there, the PERL script creates a "userName"
for the record to be entered.
5. The script then uses a SQL select command to make sure that userName
is not already in use in the DB.
"select firstName from DB where userName='$userName'
6.  If a record in the DB already has that userName, the script will
loop, and create a new userName until a unique userName is created for
that record.
7.  The record from the text file (along with its newly created
userName) is entered into the DB.
"insert into DB values ('$userName', '$key', '$firstName', '$lastName',
'$address')"
8.  The text file is deleted.

This process continues through all of the files in the specified
directory.


The only other method I can think of is to, at the very start of the
PERL script, import all of the "key" and "userName" fields from the
mySQL database.  Then, instead of querying the SQL DB at least twice for
each text file, it would just search through a large array maintained in
the PERL script.

I'm sure this method would take up more RAM (since two arrays with 30,
000 entries each would be built), but I'm wondering if it would use less
processing power, since there would be less queries to the SQL DB.  Any
ideas would be appreciated.  Thank you.

stewart eastham



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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4683
**************************************

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