[10916] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4517 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 30 10:07:23 1998

Date: Wed, 30 Dec 98 07:00:27 -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           Wed, 30 Dec 1998     Volume: 8 Number: 4517

Today's topics:
        Any NIS+ Perl Modules? <pvirgo@kong.gsfc.nasa.gov>
        external files <mox@videotron.ca>
    Re: external files <beekmans@iae.nl>
        German characters in perl script <martin.haefner@maurer-treutner.de>
        How can I identify MS Office files? <efinch@cais.com>
        How to Run Perl on DOS (FTMOM42)
        Indirection help please <Richard@nugget.demon.co.uk>
    Re: Indirection help please <ebohlman@netcom.com>
        LinkExtor <debot@xs4all.nl>
    Re: LinkExtor (brian d foy)
    Re: LinkExtor <debot@xs4all.nl>
    Re: Logging out (brian d foy)
    Re: Need help with printing date on web page <rick.delaney@home.com>
    Re: Need help with printing date on web page (Clay Irving)
    Re: New module Net::RawIP <ksv@gw.al.lg.ua>
        Newbie: string terminator <damian.hughes@hughes-associate.com>
        No UNIX command-line (FTMOM42)
    Re: Perl Cookbook dturley@pobox.com
    Re: random number problem <tlynch@cisco.com>
    Re: Retrospective on comp.lang.perl.moderated? (Leslie Mikesell)
    Re: Scale/Mode calculator <samuel@lansup.demon.co.uk>
    Re: Script for inserting HTML abbrevations (Bill Donovan)
    Re: Solution (?) to NT-Perl problem <beekmans@iae.nl>
        suppress newlines <peter.herger@swisslife.ch>
    Re: suppress newlines (Bart Lateur)
    Re: suppress newlines dave@mag-sol.com
        windows nt logon scripts <jcst@sydney.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 30 Dec 1998 09:18:46 -0500
From: "Paul Virgo.RMS.23/S411.x67878" <pvirgo@kong.gsfc.nasa.gov>
Subject: Any NIS+ Perl Modules?
Message-Id: <368A3645.AFC80734@kong.gsfc.nasa.gov>

I would like to write some web-based NIS+ apps in Perl and was wondering
if there are
any pre-written NIS+ modules I can download? Thanks in advance.

--
Paul Virgo - RMS@NASA Goddard Space Flight Center
Next on FOX: "When AMC Gremlins Attack..."





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

Date: Wed, 30 Dec 1998 04:01:16 -0500
From: Benoit Lefebvre <mox@videotron.ca>
Subject: external files
Message-Id: <3689EBDC.2DD70975@videotron.ca>

Hi, it is possible to load variables from an other file ?

I am making a kind of irc bot, using perl, and I want to do an external
configuration file, so, i'll be able to change the settings of the bot
without restarting it every time.


    thnx



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

Date: Wed, 30 Dec 1998 13:15:08 +0100
From: Marcel Beekmans <beekmans@iae.nl>
Subject: Re: external files
Message-Id: <368A194C.7557023B@iae.nl>

It very much depends on the file-type and file-format.
A little example for reading a (text)file:

open (EP, "/etc/passwd");
while (<EP>){
    chomp
    print "I saw $_ in the password file!\n";
}

(Example from: Learning perl,  page 111 O'really)

Instead of printing you simply can read it into a variable or do antything
you want with it.

Marcel.

Benoit Lefebvre wrote:

> Hi, it is possible to load variables from an other file ?
>
> I am making a kind of irc bot, using perl, and I want to do an external
> configuration file, so, i'll be able to change the settings of the bot
> without restarting it every time.
>
>     thnx



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

Date: Wed, 30 Dec 1998 12:07:42 +0100
From: Martin Haefner <martin.haefner@maurer-treutner.de>
Subject: German characters in perl script
Message-Id: <368A097E.B1D2121F@maurer-treutner.de>

Hi,

I have to develop a program on NT 4.0. While german
characters are no problem on Linux, they are on NT.
I have read about the forms problems  in the newsgroup,
but I already have the problems if it is static text
within the script.


Thanks for advice,

Martin


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

Date: Wed, 30 Dec 1998 08:00:02 -0500
From: Ed Finch <efinch@cais.com>
Subject: How can I identify MS Office files?
Message-Id: <368A23D2.10175C1D@cais.com>

Greetings!

We have about 50 Macs left in our building and are 
migrating the users to Windows. The biggest issue
is that their files weren't saved with extensions
and it's painful to use MS Office. I'd like to 
write a Perl script to read all of their files,
identify Word, Excel and PowerPoint files, and
add the appropriate extension automatically. I've
searched the modules and the FAQ to no avail.

How can I identify the file types?


Best regards,
Ed


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

Date: 30 Dec 1998 08:10:29 GMT
From: ftmom42@aol.com (FTMOM42)
Subject: How to Run Perl on DOS
Message-Id: <19981230031029.12580.00004090@ng-cr1.aol.com>

How do you run a program on DOS?


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

Date: Wed, 30 Dec 1998 12:11:43 +0000
From: Richard <Richard@nugget.demon.co.uk>
Subject: Indirection help please
Message-Id: <BbxpeHA$hhi2EwA8@nugget.demon.co.uk>

Hi,

The following snippet of code works for my purposes with the -w flag and
use strict. I am using CGI.pm. However I don't like rewriting chunks of
code when it appears that a loop could do it!


my $rest = param("Form");
if ($rest ne "") {
  foreach (@Form) { 
    s/$\>$rest/ SELECTED >$rest/
  };
};
$rest = param("Expense");
if ($rest ne "") {
  foreach (@Expense) {
    s/$\>$rest/ SELECTED >$rest/
  };
};
$rest = param("StrengthDesc");
if ($rest ne "") {
  foreach (@StrengthDesc) { 
    s/$\>$rest/ SELECTED >$rest/
  };
};
$rest = param("DoseUnits");
if ($rest ne "") {
  foreach (@DoseUnits) {
    s/$\>$rest/ SELECTED >$rest/
  };
};
$rest = param("PackSize");
if ($rest ne "") {
  foreach (@PackSize) {
    s/$\>$rest/ SELECTED >$rest/
  };
};

Therefore I would like to write something equivalent to the following

foreach $type ("Form","Expense","StrengthDesc","DoseUnits","PackSize") {
  $rest = param($type);
  if ($rest ne "") {
    foreach (@$$type) {
      s/$\>$rest/ SELECTED >$rest/
    };
  };
};

This seems to me to be more maintainable and neater. However I am
getting an error on the foreach (@$$type) statement where I want to use
a different array in each loop. I've read and re-read the man pages and
can't seem to get my head around a way of doing this.

I would be very grateful if anyone could point me in the right
direction.

Cheers

Richard
-- 
Richard Eyles                           | General techie anorak
Principal Pharmacist Computer Services  | DOS Win95 AIX HP-Unix (just)
Queen Alexandra Hospital, Portsmouth    | TCPIP IPX Novell


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

Date: Wed, 30 Dec 1998 14:50:39 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Indirection help please
Message-Id: <ebohlmanF4s98F.24L@netcom.com>

Richard <Richard@nugget.demon.co.uk> wrote:
: Therefore I would like to write something equivalent to the following

: foreach $type ("Form","Expense","StrengthDesc","DoseUnits","PackSize") {
:   $rest = param($type);
:   if ($rest ne "") {
:     foreach (@$$type) {

foreach (@{$type})

:       s/$\>$rest/ SELECTED >$rest/
:     };
:   };
: };

1) For this to work, your arrays (@Form, etc.) will have to be global 
variables, not lexical ("my") variables.

2) If you've done a "use strict" (highly recommended), you'll need to 
enclose the above code in a block that starts with "no strict refs".

3) You really ought to rethink your data structures so you don't have to 
do this.  Rather than having 5 parallel arrays with their own names, why 
not use a hash of arrays, keyed by the parameter names?  Take a look at 
the perldata, perlref, perllol and perldsc documents for some hints.


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

Date: Wed, 30 Dec 1998 11:38:37 +0100
From: Frank de Bot <debot@xs4all.nl>
Subject: LinkExtor
Message-Id: <368A02AC.7B039DFD@xs4all.nl>

Can someone give me a simple example how to use: HTML::LinkExtor  ?



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

Date: Wed, 30 Dec 1998 09:21:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: LinkExtor
Message-Id: <comdog-ya02408000R3012980921120001@news.panix.com>

In article <368A02AC.7B039DFD@xs4all.nl>, Frank de Bot <debot@xs4all.nl> posted:

> Can someone give me a simple example how to use: HTML::LinkExtor  ?

see the documentation for examples.

[you only need to post your message one, btw]

-- 
brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't.  it doesn't matter either way.


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

Date: Wed, 30 Dec 1998 15:52:17 +0100
From: Frank de Bot <debot@xs4all.nl>
Subject: Re: LinkExtor
Message-Id: <368A3E20.A04CC4C3@xs4all.nl>

Which Documentation??



brian d foy wrote:

> In article <368A02AC.7B039DFD@xs4all.nl>, Frank de Bot <debot@xs4all.nl> posted:
>
> > Can someone give me a simple example how to use: HTML::LinkExtor  ?
>
> see the documentation for examples.
>
> [you only need to post your message one, btw]
>
> --
> brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
> CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
> remove NOSPAM or don't.  it doesn't matter either way.



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

Date: Wed, 30 Dec 1998 09:24:11 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Logging out
Message-Id: <comdog-ya02408000R3012980924110001@news.panix.com>

In article <76c94q$u3n$1@nnrp1.dejanews.com>, rsarcomo@my-dejanews.com posted:

> Is there a way to logout from a perl script?  I've tried
> system("logout"),system("exit"),exec("logout"), and exec("exit") to no avail.
>  I want the script to log out after it's done running.  Thanks.

why not run the script with nohup then logout?  see the man pages for
more details.

-- 
brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't.  it doesn't matter either way.


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

Date: Wed, 30 Dec 1998 13:21:33 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Need help with printing date on web page
Message-Id: <368A2AA4.EA5D11CB@home.com>

[posted & mailed]

Loans2001 wrote:
> 
> All I'm trying to do is print the last day the file was updated on the 
> web page.
> What's so hard about this? I wish Perl would just have a function for 
> this. But I have to get the number in seconds? Is there an easier way/

Are you aware that localtime gives a readable date in a scalar context?

    $date = localtime;
    print "$date\n";

gives something like:
Wed Dec 30 08:27:42 1998

If that format is not to your liking you might want to try one of the
Date modules on CPAN.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: 30 Dec 1998 13:59:41 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Need help with printing date on web page
Message-Id: <76dbkd$bgs@news1.panix.com>

In <19981230013009.09071.00004198@ng05.aol.com> loans2001@aol.com (Loans2001) writes:

>I wrote this code...

>#<-- Begin Code -->

>$mod_time = (stat("../../coastal/rates/rates.htm"))[9];
>print $mod_time;
># Last modified time is index 9 of array returned by stat, so we
># grab that only.  We then go on to get the time in a usable
># format by supplying this number (remember it is in epoch
># seconds) to the localtime function, and return only the
># info we are interested in.

>($min,$hour,$day,$mon,$yr) = (localtime($mod_time))[1..5];

># We now need to do some modifications, because of the format
># of the numbers returned by localtime, i.e., year is the
># number of years since 1900, month numbers run from 0 to
># 11, and also remember the time is returned in 24 hour
># (military) format.  For printing, we force the hours and
># minutes to print with two numbers for cases like 00:05,
># which would normally print as 0:5.

>$yr += 1900;
>$mon++;
>$outstr = "$mon/$day/$yr at ".sprintf("%.2d",
>$hour).':'.sprintf("%.2d", $min);
>print "$outstr";

>#<-- End Code -->

>All I'm trying to do is print the last day the file was updated on the web
>page.
>What's so hard about this? I wish Perl would just have a function for this. But
>I have to get the number in seconds? Is there an easier way/

>If you can see my web page at http://www.mortgage-pros.com/cgi-bin/rates.cgi

>the program puts something strange there.  Like 112/31/1969  

>Any suggestons? 

Here's a hint:
    
A test program:

    #!/usr/local/bin/perl5 -w
    
    $mod_time = (stat("foo"))[9];
    print "$mod_time\n";
    
    ($min,$hour,$day,$mon,$yr) = (localtime($mod_time))[1..5];
    print "$min:$hour:$day:$mon:$yr\n";
    
There is no file called 'foo':

    [panix] ~% ls foo
    foo: No such file or directory.

Look at the output:

    [panix] ~% ./foo.pl
    Use of uninitialized value at ./foo.pl line 4.
    
    Use of uninitialized value at ./foo.pl line 6.
    0:19:31:11:69

Create a file called 'foo':

    [panix] ~% touch foo

Rerun the program and look at the output:

    [panix] ~% ./foo.pl
    915026181
    56:8:30:11:98

-- 
Clay Irving
clay@panix.com


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

Date: Wed, 30 Dec 1998 13:07:18 +0200
From: "Sergey V. Kolychev" <ksv@gw.al.lg.ua>
Subject: Re: New module Net::RawIP
Message-Id: <Pine.LNX.3.96.981230125019.11840A-100000@gw.al.lg.ua>

On Mon, 28 Dec 1998, Tripp Lilley wrote:

> "Sergey V. Kolychev" wrote:
> 
> > On Tue, 22 Dec 1998, Tripp Lilley wrote:
> >
> > > "William R. Ward" wrote:
> > >
> > > > Why not just Net::IP?
> > >
> > > Or, better yet, Net::IPv4.
> > >
> >
> > Sorry ,but my module related only for _raw_ IP packets
> > Look at Net::TCP ,Net::Inet from Net-ext at CPAN created by
> > Spider Boardman.
> 
> I think you've misunderstood our point. 'IP' is, by definition, 'raw IP'. TCP
> and UDP are layered on top of IP. The various INET services and protocols
> (HTTP, NNTP, SMTP, etc.) are in turn layered on top of TCP and/or UDP. Thus,
> the package name 'Net::IPv4' is perfectly accurate for your module. It is, as
> you say, for raw access to IP packets (presumably IPv4 and not IPv6, or you
> would've said otherwise).
> 
> The suggestion stands.
> 
> 
> 
> 
>From /usr/include/netinet/in.h
/* Standard well-defined IP protocols.  */
enum
  {
    IPPROTO_IP = 0,      /* Dummy protocol for TCP.  */
    IPPROTO_ICMP = 1,    /* Internet Control Message Protocol.  */
    IPPROTO_IGMP = 2,    /* Internet Group Management Protocol. */
    IPPROTO_IPIP = 4,    /* IPIP tunnels (older KA9Q tunnels use 94).  */
    IPPROTO_TCP = 6,     /* Transmission Control Protocol.  */
    IPPROTO_EGP = 8,     /* Exterior Gateway Protocol.  */
    IPPROTO_PUP = 12,    /* PUP protocol.  */
    IPPROTO_UDP = 17,    /* User Datagram Protocol.  */
    IPPROTO_IDP = 22,    /* XNS IDP protocol.  */
    IPPROTO_IPV6 = 41,   /* IPv6-in-IPv4 tunnelling.  */
    IPPROTO_ICMPV6 = 58, /* ICMPv6.  */

    IPPROTO_RAW = 255,   /* Raw IP packets.  */
    IPPROTO_MAX
  };
>From Net-RawIP-0.03c/util.c
int rawsock(void)
{
        int fd,val=1;

        if ((fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) {
                        perror("\n(rawsock) Socket problems [fatal]");
                exit(1);
        }

        if (setsockopt(fd, IPPROTO_IP, IP_HDRINCL, &val, sizeof(val)) < 0)
{
                        perror("Cannot set IP_HDRINCL socket option");
                exit(1);
        }

        return fd;
}
I think that RawIP better say what is Net::RawIP for peoples who
definitely need this module (administrators of security networks
and evil hackers ;))


   ----------------------Alchevsk Linux User Group-----------------------
      UNIX is user friendly. It's just selective who the friends are.
      Linux is like wigwam - no windows, no gates, apache inside. 
      http://www.ic.al.lg.ua/~ksv | e-mail: ksv@gw.al.lg.ua
      PGP key & Geekcode: finger ksv@gw.al.lg.ua




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

Date: Wed, 30 Dec 1998 14:49:24 +0000
From: Damian Hughes <damian.hughes@hughes-associate.com>
Subject: Newbie: string terminator
Message-Id: <368A3D73.C2CEE8B9@hughes-associate.com>

I've got the following syntax error with a perl script ....Can't find
string terminator '"' anywhere before EOF at line 792.... I've trawled
the web for a solution but the replies are at least confusing, at best
misleading. Although I don't know Perl, looking at line 792, there
appears to be nothing untoward. Can anyone please help?



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

Date: 30 Dec 1998 08:00:04 GMT
From: ftmom42@aol.com (FTMOM42)
Subject: No UNIX command-line
Message-Id: <19981230030004.12580.00004088@ng-cr1.aol.com>

I have Win98 and I dont think I have UNIX.
I have DOS, though.
I need to run perl scripts but I cant use unix commands on DOS. How do I run my
scripts?
My computer is a ItelPentiumII 64mb333mHz

I need to run my programs.
 Are there any special commands for dos to run programs?
I cant even set chmod on dos.


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

Date: Wed, 30 Dec 1998 13:06:45 GMT
From: dturley@pobox.com
Subject: Re: Perl Cookbook
Message-Id: <76d8h5$kn7$1@nnrp1.dejanews.com>

In article <76b8ad$p83$1@gail.ripco.com>,
  mikebvc@ripco.com (Mike Stillman) wrote:

> Lots of errors, too. Check the O'Reilly website for a list of errata that
> runs 25+ pages.
>

Gee, did you bother reading the info? Most of those errata are things that
have nothing to do with the programming in the book. They are only listed
because the authors are picky, it's a good thing. If the book has any fault,
its that after reading it I have to go back a re-write so much of my code.
:-)

You are doing a disservice to those considering buying the book by posting
such misleading statements.

____________________________________
David Turley
dturley@pobox.com
http://www.binary.net/dturley/

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


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

Date: Wed, 30 Dec 1998 08:28:08 -0500
From: Tom Lynch <tlynch@cisco.com>
Subject: Re: random number problem
Message-Id: <368A2A68.88843A6D@cisco.com>

Justin wrote:
> 
> i'm trying to get 10 random numbers between 0-50
> and i want all 10 random numbers to be different numbers
> so how do i make sure they are not same?

Hi:

	Here's one I got form this news group, it 
	uses the perl module Math::Random and prints
	out 5 numbers from 1 to 49.

	Tom

#!/usr/local/bin/perl -w
#
#
# Most of this example program was pulled from 
# the comp.lang.perl.modules news group. This is
# an example of random number generator that only
# gets the number once from a give string.
#

#
# Use perl Module Math::Random, see perldoc Math::Random
# 
use Math::Random qw(random_permuted_index);
#
# Set and array from 1 to 49
#
@array = (1..49);
#
# Randomize the order of indexes and put into indices
#
@indices = random_permuted_index(scalar @array);
#
# Set list to the first six elements of indices
#
@list = @array[@indices[0..5]];
#
# Numeric sort
#
@sorted = sort { $a <=> $b } @list;
#
# Print out the numbers
#
print "@sorted\n";
exit (0);

-- 
#-----------------------+--------------------------+
# Tom Lynch             | Email: tlynch@cisco.com  |
# Cisco Systems         | Phone: 978-244-8765      | 
# 250 Apollo Drive      | FAX:   978-244-8039      |
# Chelmsford MA 01824   | MS:    CH1-2LF           |
#-----------------------+--------------------------+


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

Date: 30 Dec 1998 02:29:52 -0600
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <76coa0$c0d$1@Jupiter.mcs.net>

In article <1dktfwl.1jx9aol1mzemdkN@bos-ip-1-101.ziplink.net>,
Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:

>> I know who I am.  Why should I attempt to prove it to someone else
>> using an unreliable medium just so I could answer someone else's
>> question?
>
>So that every poster will read the about the many resources available
>(documentation/FAQ, other appropriate newsgroups, etc.) *before* having
>a message posted to the newsgroup.  This should mean much less work for
>the moderators, with a trivial, one-time inconvenience for all posters.

Hmmm, one would think that if the moderator-approved question wasn't
something from the FAQ, then the answer I tried to post probably
wasn't either.

>By the way, you can still answer someone else's question just by
>emailing them directly.  If that's not too much of a "bother" for you.

If the poster had asked for an email response I would have sent one.

>Sadly, the perl debugger will not help you find the bug up your ass.

I'm not the one contriving artificial and arbitrary devices to keep
questions and answers separated.  What bug?

  Les Mikesell
   les@mcs.com


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

Date: Wed, 30 Dec 1998 12:36:19 +0000
From: Samuel Hogarth <samuel@lansup.demon.co.uk>
Subject: Re: Scale/Mode calculator
Message-Id: <2mNi+PAD5hi2Iwcc@lansdown.demon.co.uk>

At 22:34:58 on Tue, 29 Dec 1998, our lives were enlightened by the words
of Mike McManus, as follows:
>Samuel Hogarth wrote:
>> 
>> At 22:01:48 on Mon, 28 Dec 1998, our lives were enlightened by the words
>> of Bill Huston, as follows:
>> >  "periodic table" of scales (from 12 sharps to 12 flats),
>> 
>> What will the periodic table look like? Wouldn't you be better off
>> with a cycle of fifths?
>
>I tried this with key signatures recently. At six sharps/six flats
>the cycle of fifths "wraps around" (six sharps and six flats are
>enharmonic keys, and seven sharps and five flats are also enharmonic
>and vice versa).
>
>Are key signatures beyond seven sharps/flats used at all (in which
>case double sharps or double flats would need to be used) or are
>they simply avoided by spelling the key signature in an enharmonic
>key? I would suspect the latter as I have never seen key signatures
>using double sharps or flats.
>
Not used for key signatures as such, AFAIK, but they may be used in
sections of pieces. If you modulate from Gb major to Cb major and then
down another fifth, you would probably go into Fb major - assuming you
weren't planning on staying there very long :-). Check out a piece by
Rachmaninov that starts in G# minor for solo piano - unfortunately I
can't remember the title but someone else may do. It is full of double
accidentals.

Samuel Hogarth

'It's not my fault, I'm only ickle'

(to reply, replace 'up' with 'down')


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

Date: Wed, 30 Dec 1998 12:59:03 GMT
From: willondon@bigfoot.com (Bill Donovan)
Subject: Re: Script for inserting HTML abbrevations
Message-Id: <368a20f1.967284@news.gtn.net>

Kjetil Kjernsmo wrote:
> [...]
> I thought about start writing a script to insert HTML ABBRs and
> ACRONYMs in existing HTML files, by having the program look up a list
> of common abbrevations and acronyms (as well as my own) and their
> expansions, but first I figured I'll ask if someone already wrote such
> a script.  [...]

I wrote a program that does mass replacements on files.  It searches all
levels under a given directory for files with the specified file
extension.  With the files that qualify, it searches for the desired
string and replaces it with another.  I developed it under Windows 3.1,
but it should work under Win95, 98 and NT as well.  It shouldn't be too
hard to port to another OS; the only OS specific things I can think of are
reading an .INI file, and some of the directory routines.

> [...]  it seems like my greatest difficulty now is to make sure I'm not
> inserting ABBRs inside HTML tags. [...]

Since I intended it for mass updates of HTML files, I did allow for a
"safe zone" between <pre></pre> tags, but that's about it.

You can use the reply address on this post to request a copy.

-- 
Bill Donovan / willondon@bigfoot.com


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

Date: Wed, 30 Dec 1998 13:00:13 +0100
From: Marcel Beekmans <beekmans@iae.nl>
Subject: Re: Solution (?) to NT-Perl problem
Message-Id: <368A15CC.EB39A756@iae.nl>

I don't understand the problem. Wht don't you just make a cgi-bin directory in
your wwwroot-directory and give it script execute rights and the problem is
solved ??

Marcel Beekmans

Shana Priwer wrote:

> I've been struggling with getting cgi scripts to run on the web server I
> host through IIS, and as I've found a solution that works for my setup,
> I thought I'd post it and see if it works for anyone else. Also, if
> anyone notices major problems with my solution, please let me know  :)
>
> When you install IIS it makes a directory called d:\InetPub. Regular
> files for the web should be placed in the wwwroot directory inside
> inetpub, but cgi files placed there will not run correctly. If you
> create a cgi-bin directory inside the scripts directory, place your cgi
> files in the cgi-bin and your linked .htm files inside the scripts
> directory, things work and scripts run.
>
> Also you need to do the scriptmap reg entry (see Vincent Bezard's
> posting from yesterday)
>
> ---== http://www.newsfeeds.com - Largest Usenet Server In The World! ==---
>
> ---== http://www.newsfeeds.com - Largest Usenet Server In The World! ==---



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

Date: Wed, 30 Dec 1998 09:03:23 +0100
From: Herger Peter <peter.herger@swisslife.ch>
Subject: suppress newlines
Message-Id: <3689DE4B.FED59431@swisslife.ch>

Hello

Thanks Clay for this tip. I's really the problem with those extra
newlines!!!
But if I delete all \n, one newline is still there. My testscript:

    !/usr/local/bin/perl -w

    $storedir = `date '+%m%d'`;

    print "$storedir";

I get the following output:

    $ ./foo.pl | od -c
    0000000   1   2   3   0  \n
    0000005

How can I suppress this newline??

Thanks

-Peter




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

Date: Wed, 30 Dec 1998 10:10:51 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: suppress newlines
Message-Id: <368cfbec.1200825@news.skynet.be>

Herger Peter wrote:

>    $storedir = `date '+%m%d'`;
>    print "$storedir";
>
>I get the following output:
>
>    $ ./foo.pl | od -c
>    0000000   1   2   3   0  \n
>    0000005
>
>How can I suppress this newline??

    ($storedir = `date '+%m%d'`)=~ tr/\n//d;
    print "$storedir";

   HTH,
   Bart.


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

Date: Wed, 30 Dec 1998 13:41:28 GMT
From: dave@mag-sol.com
Subject: Re: suppress newlines
Message-Id: <76dai8$m32$1@nnrp1.dejanews.com>

In article <3689DE4B.FED59431@swisslife.ch>,
  Herger Peter <peter.herger@swisslife.ch> wrote:
> Hello
>
> Thanks Clay for this tip. I's really the problem with those extra
> newlines!!!
> But if I delete all \n, one newline is still there. My testscript:
>
>     !/usr/local/bin/perl -w
>
>     $storedir = `date '+%m%d'`;
>
>     print "$storedir";
>
> I get the following output:
>
>     $ ./foo.pl | od -c
>     0000000   1   2   3   0  \n
>     0000005
>
> How can I suppress this newline??

chomp $storedir;

--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>

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


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

Date: Thu, 31 Dec 1998 00:16:10 +1100
From: "Sean Toms" <jcst@sydney.net>
Subject: windows nt logon scripts
Message-Id: <915020310.182368@gandhi.apic.net>

Hello. Could someone please tell me where I can find some examples of NT
logon scripts written in Perl. Alternatively is someone could provide some
examples??
Thanks heaps.

Sean Toms





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

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 4517
**************************************

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