[19267] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1462 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 8 09:06:42 2001

Date: Wed, 8 Aug 2001 06:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <997275914-v10-i1462@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 8 Aug 2001     Volume: 10 Number: 1462

Today's topics:
    Re: action=stuff? <paul@net366.com>
        Another string manipulation question <sleddog@operamail.com>
    Re: Another string manipulation question <paul@net366.com>
    Re: Easy array question ? <tony_curtis32@yahoo.com>
        FAQ: How do I handle binary data correctly? <faq@denver.pm.org>
    Re: For loop aliasing?? <aether@centurytel.net>
        FTP commands <jeroen.erkens@ing-barings.com>
    Re: FTP commands <tony_curtis32@yahoo.com>
        getting the name of a sub from a sub ref <john.imrie@pa.press.net>
        Hash, List, Ref Problem <philippe.perrin@sxb.bsf.alcatel.fr>
    Re: How do I select a random element from an array? <iltzu@sci.invalid>
        IF $FileArray[$index] CONTAINS..... (Pete Sohi)
    Re: IF $FileArray[$index] CONTAINS..... <paul@net366.com>
    Re: IF $FileArray[$index] CONTAINS..... <paul@net366.com>
    Re: IF $FileArray[$index] CONTAINS..... (Michel Dalle)
    Re: IF $FileArray[$index] CONTAINS..... (Michel Dalle)
    Re: IF $FileArray[$index] CONTAINS..... <paul@net366.com>
    Re: Index maker <Graham.T.Wood@oracle.com>
    Re: Index maker <horneja@ufl.edu>
    Re: installing modules (xml::sablotron) on win32/active (Eric Bohlman)
    Re: installing modules (xml::sablotron) on win32/active <kmojar@bmjgroup.com>
    Re: Line counting in a file brianr@liffe.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 8 Aug 2001 12:58:55 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: action=stuff?
Message-Id: <997271857.26136.0.nnrp-01.d4f094e4@news.demon.co.uk>

I've just done my first go at the same thing.

I found it useful to attach script (Java) to the 'buttons' which are
actually images with onlick=clickroutine(), so you can animate them up a bit
using multiple images, preloading etc.

The page has a form with a type='hidden' text, which I use with
document.FORM1.hiddenthing.value="x" where x is dependant on the button you
click. It works, see other responses re use CGI etc., then
$cgithing->query('hiddenthing') will have the value x.

HTH

Tim Toady


"Nathan Randle" <nathan.randle@ntlworld.com> wrote in message
news:LMXb7.17082$3K2.2065420@news6-win.server.ntlworld.com...
> I want to put links on a page that lead to a perl script in the form
> action=something. and each action will perform a different job
>
> I have seen other pages using this method and as a Perlish newbie I would
> like to know :-)
>
> hope you can help
> Nathan
>
>




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

Date: Wed, 08 Aug 2001 11:17:01 GMT
From: Doug Robbins <sleddog@operamail.com>
Subject: Another string manipulation question
Message-Id: <MPG.15dafeed4f047dc9896a1@news1.ns.sympatico.ca>

I have a string like this (for example) whic a perl script is getting 
from a generated text file:

03:00 PM EST

Problem is, the hour is off by one hour (slow). Hour can I increment 
the hour by one? In other words, when the original string contains 
03:00 I want 04:00, when its 06:00 I want 07:00, etc. Get's trickier 
when we get to 12:00...

Of course I could simply replace 'EST' with 'CST' but that would be too 
easy :)

Any help appreciated,  thanks.

-- 
Doug Robbins


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

Date: Wed, 8 Aug 2001 12:45:38 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: Another string manipulation question
Message-Id: <997271059.25768.0.nnrp-01.d4f094e4@news.demon.co.uk>

This is without a doubt the longets answer you will get. I await with
interest the 'right' way to do this, from the experts.
But this is how C programmers (old ones at that) would do something like
this ...
$t="11:00 PM EST";
$ampm=substr($t, 6, 2);
$newt=substr($t, 0, 2)+1 ;
if ($newt==13) {
$newt=1;
$ampm="PM";
}
if ($newt==12&&($ampm eq "PM")) {
$newt=0;
$ampm="AM";
}
$u=sprintf ("%02d%03s%s%s\r\n",$newt,substr($t,2,4),$ampm,substr($t,8));
print "$u\r\n";


"Doug Robbins" <sleddog@operamail.com> wrote in message
news:MPG.15dafeed4f047dc9896a1@news1.ns.sympatico.ca...
> I have a string like this (for example) whic a perl script is getting
> from a generated text file:
>
> 03:00 PM EST
>
> Problem is, the hour is off by one hour (slow). Hour can I increment
> the hour by one? In other words, when the original string contains
> 03:00 I want 04:00, when its 06:00 I want 07:00, etc. Get's trickier
> when we get to 12:00...
>
> Of course I could simply replace 'EST' with 'CST' but that would be too
> easy :)
>
> Any help appreciated,  thanks.
>
> --
> Doug Robbins




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

Date: 08 Aug 2001 05:38:55 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Easy array question ?
Message-Id: <87g0b2n8e8.fsf@limey.hpcc.uh.edu>

>> On Wed, 08 Aug 2001 10:57:58 +0200,
>> Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr> said:

> Hi This is certainly easy for some of you, but I can't
> figure out how to remove the FIRST element of an array
> (in the same way as pop() removes the LAST)...  Of
> course, I'd like to avoid using reverse+pop+reverse :-)

perldoc -f `last word of perldoc -f pop`

hth
t
-- 
Beep beep!  Out of my way, I'm a motorist!


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

Date: Wed, 08 Aug 2001 12:17:02 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: How do I handle binary data correctly?
Message-Id: <25ac7.132$T3.170725376@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  How do I handle binary data correctly?

    Perl is binary clean, so this shouldn't be a problem. For example, this
    works fine (assuming the files are found):

        if (`cat /vmunix` =~ /gzip/) {
            print "Your kernel is GNU-zip enabled!\n";
        }

    On less elegant (read: Byzantine) systems, however, you have to play
    tedious games with "text" versus "binary" files. See the section on
    "binmode" in the perlfunc manpage or the perlopentut manpage. Most of
    these ancient-thinking systems are curses out of Microsoft, who seem to
    be committed to putting the backward into backward compatibility.

    If you're concerned about 8-bit ASCII data, then see the perllocale
    manpage.

    If you want to deal with multibyte characters, however, there are some
    gotchas. See the section on Regular Expressions.

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           04.68
-- 
    This space intentionally left blank


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

Date: Wed, 8 Aug 2001 07:39:17 -0500
From: "Aether" <aether@centurytel.net>
Subject: Re: For loop aliasing??
Message-Id: <9krbtq$62uba$1@ID-101733.news.dfncis.de>

I did try it and it did nothing.

Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote in message
news:slrn9n1l3k.jt8.sholden@pgrad.cs.usyd.edu.au...
> On Wed, 8 Aug 2001 00:44:17 -0500, Aether <aether@centurytel.net> wrote:
> >Yes $string gets assigned to $_. If there were multiple iterations of the
> >loop (like a for each) the same would happen for each value. And yes $_
is
> >the target of a reg ex without an explicit target.
> >
> >One difference between this version and yours is that the "loop" does not
> >alter the value of $string. It assigns it to $_ and modifies that. Of
> >course, this code does nothing with $_ so the loop does nothing.
>
> It in fact does modify $string, since $_ is made an alias for $string.
> Perhaps you should try things out before declaring them as facts...
>
> --
> Sam Holden




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

Date: Wed, 08 Aug 2001 13:08:26 +0100
From: Jeroen <jeroen.erkens@ing-barings.com>
Subject: FTP commands
Message-Id: <3B712BBA.FDA4BB14@ing-barings.com>

Hi,

We have a unix script which FTPs, which uses the following FTP commands:

quote authenticate blargh
quote response blargh

How can I do this in PERL? If it's using  ftp->quot(cmd[, args]), how do
I determine whether the command has been successful?

Cheers,
Jeroen,

jeroen.erkens@ing-barings.com



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

Date: 08 Aug 2001 07:49:13 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: FTP commands
Message-Id: <878zguaf92.fsf@limey.hpcc.uh.edu>

>> On Wed, 08 Aug 2001 13:08:26 +0100,
>> Jeroen <jeroen.erkens@ing-barings.com> said:

> Hi, We have a unix script which FTPs, which uses the
> following FTP commands:

> quote authenticate blargh quote response blargh

> How can I do this in PERL? If it's using ftp->quot(cmd[,
> args]), how do I determine whether the command has been
> successful?

What does the documentation say?  You'll find the answer,
as usual, in the relevant perldoc, viz. Net::FTP.


-- 
Beep beep!  Out of my way, I'm a motorist!


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

Date: Wed, 8 Aug 2001 11:55:28 +0100
From: John Imrie <john.imrie@pa.press.net>
Subject: getting the name of a sub from a sub ref
Message-Id: <jV8c7.241$t97.2458@news.uk.colt.net>

is it possible to extract the name of the subrouteen pointed to by a sub ref


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

Date: Wed, 08 Aug 2001 14:35:29 +0200
From: Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr>
Subject: Hash, List, Ref Problem
Message-Id: <3B713211.1667A03C@sxb.bsf.alcatel.fr>

Hi

Here's a summary of my problem...

@list = (1, 2);
%h = (10 => \@list);
$refList = $h{10};
($a, $b) = @$refList;
print "[$a] [$b]\n"; # I get [1] [2] ==> OK

So why does the following NOT work ?

@list = (1, 2);
%h = (10 => \@list);
($a, $b) = @$h{10};
print "[$a] [$b]\n"; # I get [] [] ==> :-(

Thnx

-- 
PhP


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

Date: 8 Aug 2001 10:05:39 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: How do I select a random element from an array?
Message-Id: <997263795.3443@itz.pp.sci.fi>

In article <9kiqd9$59d$1@charity.cs.utexas.edu>, Logan Shaw wrote:
>think.  I once wrote a Perl program to generate an approximate
>value of e using a law of probability that relies on shuffling an
>array randomly.  I used the fisher-yates shuffle from the FAQ, but
>I made a very slight change (can't remember what) that seemed
>completely insignificant.  Lo and behold, I was getting numbers
>that were nowhere near 2.71828.  I changed it to work exactly like
>what's listed in the FAQ, and suddenly my numbers came out right.

Let me guess: Instead of

  for my $i (reverse 1 .. $#array) {
      my $j = int rand($i+1);
      @array[$i, $j] = @array[$j, $i];
  }

you made the second line read either

      my $j = int rand($i);

or perhaps

      my $j = int rand(@array);

Both of these skew the distribution in subtle ways that might not be
noticeable without the kind of statistical analysis your code did.  I'd
call this one of the Frequently Introduced Bugs of programming.


>The moral?  Shuffling an array randomly isn't actually an
>easy problem, and if you don't understand it, copying the
>code from "perldoc -q shuffle" is the best way to go.

Actually, the Fisher-Yates shuffle can be quite easy to visualize.  What
it's doing is equivalent to this:

  my @shuffled;
  while (@array) {
      push @shuffled, splice @array, rand(@array), 1;
  }

It's picking a random element from the array, splicing it out and
storing it, and repeating until no unshuffled items are left.  The
clever bit is realizing that the cost O(n) of the splice() can be
optimized out by moving the chosen item to the front of the array:

  my @shuffled;
  while (@array) {
      my $j = rand(@array);
      @array[0, $j] = @array[$j, 0];  # move chosen item to front
      push @shuffled, shift @array;   # shift is O(1), splice is O(n)
  }

It then takes only a little bit of cleverness to notice that you don't
have to do the push/shift bit at all, if you just keep an index that
separates the shuffled and unshuffled parts of the array:

  for my $i (0 .. $#array) {
      my $j = $i + rand(@array - $i);
      @array[$i, $j] = @array[$j, $i];  # move chosen item to $i
  }
  # @array is now shuffled in place

This is exactly same as the code I wrote at the beginning of the
message, except that this one keeps the shuffled part below the
unshuffled one, while the earlier one does the opposite.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



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

Date: 8 Aug 2001 04:02:42 -0700
From: amanpreet.sohi@sbs.siemens.co.uk (Pete Sohi)
Subject: IF $FileArray[$index] CONTAINS.....
Message-Id: <1ab8c4be.0108080302.6b546fdd@posting.google.com>

Saviours and brave developers alike:

I am a Java (and ABAP) developer out of my normal territory and find
myself wrestling with Perl for the first time.

I have an array containing scalars (filenames [strings]) and want to
traverse it searching for filenames which CONTAIN x char sequence....

The conditions being CONTAINS. (I would have expected a nice keyword
like EXISTS or CS [as it is in ABAP] but there isnt one)

Yelp yelp!...

:-)

Thanks in advance.

Pete.


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

Date: Wed, 8 Aug 2001 12:20:39 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: IF $FileArray[$index] CONTAINS.....
Message-Id: <997269568.25196.0.nnrp-01.d4f094e4@news.demon.co.uk>

As a newbie myself, I've found grep is good for this. Or indeed foreach.

like
$x[0]="fred";
$x[1]="bert";
$x[2]="freddie";

@y=grep(m/fred/, @x);

print "@y\r\n";

@y will have all the things @x had, containing 'fred'.

Apologies to all Perl experst who will come up with a much better answer!

If this isn't what you're looking for, my apologies and press DELETE!

"Pete Sohi" <amanpreet.sohi@sbs.siemens.co.uk> wrote in message
news:1ab8c4be.0108080302.6b546fdd@posting.google.com...
> Saviours and brave developers alike:
>
> I am a Java (and ABAP) developer out of my normal territory and find
> myself wrestling with Perl for the first time.
>
> I have an array containing scalars (filenames [strings]) and want to
> traverse it searching for filenames which CONTAIN x char sequence....
>
> The conditions being CONTAINS. (I would have expected a nice keyword
> like EXISTS or CS [as it is in ABAP] but there isnt one)
>
> Yelp yelp!...
>
> :-)
>
> Thanks in advance.
>
> Pete.




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

Date: Wed, 8 Aug 2001 12:23:27 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: IF $FileArray[$index] CONTAINS.....
Message-Id: <997269732.25265.0.nnrp-01.d4f094e4@news.demon.co.uk>

Or indeed :
foreach $x (@x) {
    print "$x\r\n" if ($x=~/fred/);
}

Tim Toady

"Pete Sohi" <amanpreet.sohi@sbs.siemens.co.uk> wrote in message
news:1ab8c4be.0108080302.6b546fdd@posting.google.com...
> Saviours and brave developers alike:
>
> I am a Java (and ABAP) developer out of my normal territory and find
> myself wrestling with Perl for the first time.
>
> I have an array containing scalars (filenames [strings]) and want to
> traverse it searching for filenames which CONTAIN x char sequence....
>
> The conditions being CONTAINS. (I would have expected a nice keyword
> like EXISTS or CS [as it is in ABAP] but there isnt one)
>
> Yelp yelp!...
>
> :-)
>
> Thanks in advance.
>
> Pete.




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

Date: Wed, 08 Aug 2001 11:25:18 GMT
From: news@mikespub.net (Michel Dalle)
Subject: Re: IF $FileArray[$index] CONTAINS.....
Message-Id: <9kr7uo$nga$1@dackel.pdb.sbs.de>

In article <1ab8c4be.0108080302.6b546fdd@posting.google.com>, amanpreet.sohi@sbs.siemens.co.uk (Pete Sohi) wrote:
>Saviours and brave developers alike:
>
>I am a Java (and ABAP) developer out of my normal territory and find
>myself wrestling with Perl for the first time.
>
>I have an array containing scalars (filenames [strings]) and want to
>traverse it searching for filenames which CONTAIN x char sequence....
>
>The conditions being CONTAINS. (I would have expected a nice keyword
>like EXISTS or CS [as it is in ABAP] but there isnt one)
>

The magic keyword is index() :

if (index($FileArray[$index],"look for this") > -1) {
        print "Yep, I found it !\n";
}
else {
        print "Sorry, I didn't find it...\n";
}

For more advanced search patterns, use pattern matching :

if ($FileArray[$index] =~ m#\b(this|that)\b#i) {
        print "It contains this or tHat\n";
}

HTH,

Michel.

-- 
Welcome to Mike's Pub
http://mikespub.net/forum/


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

Date: Wed, 08 Aug 2001 11:40:10 GMT
From: news@mikespub.net (Michel Dalle)
Subject: Re: IF $FileArray[$index] CONTAINS.....
Message-Id: <9kr8qk$nga$3@dackel.pdb.sbs.de>

In article <9kr7uo$nga$1@dackel.pdb.sbs.de>, news@mikespub.net (Michel Dalle) wrote:
>In article <1ab8c4be.0108080302.6b546fdd@posting.google.com>,
> amanpreet.sohi@sbs.siemens.co.uk (Pete Sohi) wrote:
>>Saviours and brave developers alike:
>>
>>I am a Java (and ABAP) developer out of my normal territory and find
>>myself wrestling with Perl for the first time.
>>
>>I have an array containing scalars (filenames [strings]) and want to
>>traverse it searching for filenames which CONTAIN x char sequence....
>>
>>The conditions being CONTAINS. (I would have expected a nice keyword
>>like EXISTS or CS [as it is in ABAP] but there isnt one)
>>
[snip index() and m##]

Oops, missed the part about wanting to search through the 'whole'
array instead of just that element.

Yes, grep() would be OK if you don't need to know the index of the
matching elements. Otherwise, you can loop through the array
and use index(), as I mentioned before.

You might also want to look up the map() function if you're going
to play with lists.

Michel.

-- 
Welcome to Mike's Pub
http://mikespub.net/forum/


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

Date: Wed, 8 Aug 2001 12:52:03 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: IF $FileArray[$index] CONTAINS.....
Message-Id: <997271449.25943.0.nnrp-01.d4f094e4@news.demon.co.uk>

Nice one Mike.

I am VERY new to Perl, I only learnt it last weekend :) with a LOT of help
from Ilya Martynov who is great.

I hope my answers, naive as they are, will help other newbies because that
is where I'm coming from. I am trying to put something back into the
newsgroup which helped me.

Let me know if I should hide until I am much better!

Regards - Paul

PS Top Pub!

"Michel Dalle" <news@mikespub.net> wrote in message
news:9kr8qk$nga$3@dackel.pdb.sbs.de...
> In article <9kr7uo$nga$1@dackel.pdb.sbs.de>, news@mikespub.net (Michel
Dalle) wrote:
> >In article <1ab8c4be.0108080302.6b546fdd@posting.google.com>,
> > amanpreet.sohi@sbs.siemens.co.uk (Pete Sohi) wrote:
> >>Saviours and brave developers alike:
> >>
> >>I am a Java (and ABAP) developer out of my normal territory and find
> >>myself wrestling with Perl for the first time.
> >>
> >>I have an array containing scalars (filenames [strings]) and want to
> >>traverse it searching for filenames which CONTAIN x char sequence....
> >>
> >>The conditions being CONTAINS. (I would have expected a nice keyword
> >>like EXISTS or CS [as it is in ABAP] but there isnt one)
> >>
> [snip index() and m##]
>
> Oops, missed the part about wanting to search through the 'whole'
> array instead of just that element.
>
> Yes, grep() would be OK if you don't need to know the index of the
> matching elements. Otherwise, you can loop through the array
> and use index(), as I mentioned before.
>
> You might also want to look up the map() function if you're going
> to play with lists.
>
> Michel.
>
> --
> Welcome to Mike's Pub
> http://mikespub.net/forum/




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

Date: Wed, 08 Aug 2001 10:51:37 +0100
From: Graham Wood <Graham.T.Wood@oracle.com>
Subject: Re: Index maker
Message-Id: <3B710BA9.CD904CA3@oracle.com>

This is a multi-part message in MIME format.
--------------5489EC0DC1B4D658B6266229
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Jim Horne wrote:

> We need a script that will produce an index in an shtml page any .doc, .ppt
> and .pdf files in the directory.  We have a makeindex script that will
> perform this task if the files are htm, html or shtml files.  That script is
> below
> Can this script be edited to handle the above mentioned file extensions?
> This script is launched using an include command in the shtml page.

Have you tried it?  Taking a wild guess I'd say you just need to put in some of
the

while(<*.extension_you_want>){
    print_link($_);
}

loops for *.pdf, *.doc and *.ppt and Bob will be your uncle.  Take out the loops
for extensions you don't want to see, like *.htm and *.html.

Graham Wood

>
> while(<*.htm>){
>   print_link($_);
> }
> while(<*.html>){
>   print_link($_);
> }
> while(<*.shtml>){
>   print_link($_);
> }
>
> sub print_link {
>   $filename = $_[0];
>   ($filename eq $ENV{'DOCUMENT_NAME'}) && return;
>   if (open(FILE,"< $filename")) {
>     while (<FILE>) {
>       if ((m!<title>(.*)</title>!i) ||
>           (m/<!--#set\s+var="title"\s+value="([^"]*)"-->/i)) {
>         print "\<li\>\<a href=\"$filename\"\>$1\<\/a\>\n";
>         close(FILE);
>         return;
>       }
>     }
>     close(FILE);
>   }
>   print "\<li\>\<a href=\"$filename\"\>$filename\<\/a\>\n";
>   return;
> }
>
> Thanks,Jim

--------------5489EC0DC1B4D658B6266229
Content-Type: text/x-vcard; charset=UTF-8;
 name="Graham.T.Wood.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Graham Wood
Content-Disposition: attachment;
 filename="Graham.T.Wood.vcf"

begin:vcard 
n:;Graham
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:Graham.T.Wood@oracle.com
fn:Graham Wood
end:vcard

--------------5489EC0DC1B4D658B6266229--



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

Date: Wed, 8 Aug 2001 08:54:14 -0400
From: "Jim Horne" <horneja@ufl.edu>
Subject: Re: Index maker
Message-Id: <9krcqa$125u$1@spnode25.nerdc.ufl.edu>

Graham,

We tried the trick you mentioned and the script hung but did not produce any
errors.  Thanks for the reply.

Jim


"Graham Wood" <Graham.T.Wood@oracle.com> wrote in message
news:3B710BA9.CD904CA3@oracle.com...
> Jim Horne wrote:
>
> > We need a script that will produce an index in an shtml page any .doc,
 .ppt
> > and .pdf files in the directory.  We have a makeindex script that will
> > perform this task if the files are htm, html or shtml files.  That
script is
> > below
> > Can this script be edited to handle the above mentioned file extensions?
> > This script is launched using an include command in the shtml page.
>
> Have you tried it?  Taking a wild guess I'd say you just need to put in
some of
> the
>
> while(<*.extension_you_want>){
>     print_link($_);
> }
>
> loops for *.pdf, *.doc and *.ppt and Bob will be your uncle.  Take out the
loops
> for extensions you don't want to see, like *.htm and *.html.
>
> Graham Wood
>
> >
> > while(<*.htm>){
> >   print_link($_);
> > }
> > while(<*.html>){
> >   print_link($_);
> > }
> > while(<*.shtml>){
> >   print_link($_);
> > }
> >
> > sub print_link {
> >   $filename = $_[0];
> >   ($filename eq $ENV{'DOCUMENT_NAME'}) && return;
> >   if (open(FILE,"< $filename")) {
> >     while (<FILE>) {
> >       if ((m!<title>(.*)</title>!i) ||
> >           (m/<!--#set\s+var="title"\s+value="([^"]*)"-->/i)) {
> >         print "\<li\>\<a href=\"$filename\"\>$1\<\/a\>\n";
> >         close(FILE);
> >         return;
> >       }
> >     }
> >     close(FILE);
> >   }
> >   print "\<li\>\<a href=\"$filename\"\>$filename\<\/a\>\n";
> >   return;
> > }
> >
> > Thanks,Jim
>




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

Date: 8 Aug 2001 10:30:48 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: installing modules (xml::sablotron) on win32/activestate...
Message-Id: <9kr4co$rbo$3@bob.news.rcn.net>

Kourosh A Mojar <kmojar@bmjgroup.com> wrote:
> im a novice perl user on win32 (95) using active state perl. i need to
> set-up and install sablotron to run some scripts that have been given to
> me. i have followed all the instructions and installed expat
> (http://sourceforge.net/projects/expat) and sablotron (gingerall.com)
> and included in my environment path and seem to be executable. i cant
> seem to make heads or tails of installing the perl module
> xml::sablotron. i have downloaded the perl make files but have not had
> experience (at least not successful experience) in installing modules
> manually via make maker etc. as i have been used to updating my common
> modules via ppm interface with win32 perl. it seems that when running
> make file i get various unsuccessful and bad command errors. i have also
> tried to make more sense of this by downloading nmake (or some microsoft
> equivalent) as suggested by readme files.

> if any one has any previous experience or could guide me (how stupid i
> may be) on how to install sablotron on my windows machine.

Randy Kobes has a PPD for XML::Sablotron on his site: 
<URL:http://theoryx5.uwinnipeg.ca/ppmpackages>.



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

Date: Wed, 08 Aug 2001 12:29:08 +0100
From: Kourosh A Mojar <kmojar@bmjgroup.com>
To: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: installing modules (xml::sablotron) on win32/activestate...
Message-Id: <3B712284.CA3D5BBB@bmjgroup.com>

hi,

many thanks for your reply. what you've suggested seems straight forward
but how do i manually install the ppd file (with or without ppm)?

ive tried the ppm install command as so:
ppm install F:\BMJCEShared\ce_digital\scripting\avantgo-build\8aug
XML-Sablotron.ppd

Error installing package
'F:\BMJCEShared\ce_digital\scripting\avantgo-build\8aug
': Could not locate a PPD file for package
F:\BMJCEShared\ce_digital\scripting\a
vantgo-build\8aug
Error installing package 'XML-Sablotron.ppd': Read of ./ failed

as i haven't done this before i would appreciate help (a lot).

kind regards,

kourosh



Eric Bohlman wrote:
> 
> Kourosh A Mojar <kmojar@bmjgroup.com> wrote:
> > im a novice perl user on win32 (95) using active state perl. i need to
> > set-up and install sablotron to run some scripts that have been given to
> > me. i have followed all the instructions and installed expat
> > (http://sourceforge.net/projects/expat) and sablotron (gingerall.com)
> > and included in my environment path and seem to be executable. i cant
> > seem to make heads or tails of installing the perl module
> > xml::sablotron. i have downloaded the perl make files but have not had
> > experience (at least not successful experience) in installing modules
> > manually via make maker etc. as i have been used to updating my common
> > modules via ppm interface with win32 perl. it seems that when running
> > make file i get various unsuccessful and bad command errors. i have also
> > tried to make more sense of this by downloading nmake (or some microsoft
> > equivalent) as suggested by readme files.
> 
> > if any one has any previous experience or could guide me (how stupid i
> > may be) on how to install sablotron on my windows machine.
> 
> Randy Kobes has a PPD for XML::Sablotron on his site:
> <URL:http://theoryx5.uwinnipeg.ca/ppmpackages>.

-- 
Kourosh A Mojar, IT Co-ordinator, BMJ Clinical Evidence
BMJ Publishing Group, BMA House, Tavistock Square, London
Tel: (44) 20 7383 6868           Fax: (44) 20 7383 6242
e-mail: kmojar@bmjgroup.com      www.clinicalevidence.org

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager (cfolkes@bmjgroup.com)

www.clinicalevidence.org
**********************************************************************


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

Date: 08 Aug 2001 13:42:04 +0100
From: brianr@liffe.com
Subject: Re: Line counting in a file
Message-Id: <vtvgjy910j.fsf@liffe.com>

Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> writes:

> Z. Garofalakh wrote:
> 
> >Does anyone know how can a perl script open a text file and count its
> >lines?
> >I tried to use the following code lines but it didn't work!:(
 ...
> According to Ilya, this works....yet, isn't it terribly complicated
> doing it thus?
> 
> I'd write:
> 
> open FILE, $filename or die "Error: Can't open $filename: $!";
> my $lines;
> while (<FILE>) { $lines++ }

Or even:

perl -ne 'sub END {print "$.\n"}' <filename>

-- 
Brian Raven

/* we have tried to make this normal case as abnormal as possible */
             -- Larry Wall in cmd.c from the perl source code


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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


------------------------------
End of Perl-Users Digest V10 Issue 1462
***************************************


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