[11451] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5051 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 4 07:07:32 1999

Date: Thu, 4 Mar 99 04:00:23 -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           Thu, 4 Mar 1999     Volume: 8 Number: 5051

Today's topics:
    Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Pos <Philip.Newton@datenrevision.de>
        [ANNOUNCE] "StatsView" Solaris OS stats viewer 1.0 rele (Alan Burlison)
        [ANNOUNCE] Oracle tool "explain" 1.0 released (Alan Burlison)
        Banner System <flanker@sonnet.ru>
        client-side script to search files in the server <seugenio@man.amis.com>
    Re: date (week number) <sb@sdm.de>
    Re: Do you really need to do 'open(whatever, ..) or die <Philip.Newton@datenrevision.de>
        Help needed on pattern matching in reverse rnbernardo@yahoo.com
    Re: Help needed on pattern matching in reverse <Tony.Curtis+usenet@vcpc.univie.ac.at>
        HELP: Socket based script under Win32 brethel@dcc.unicamp.br
    Re: How do i get the first 100 words from a paragraph <staffan@ngb.se>
        Info4s about File::Find <Dirk.Schumacher@depot147.dpd.de>
    Re: Inserting a 'newline' in arrays? (Bart Lateur)
        Looking for a spider script johnny99@sydney.dialix.oz.au
        Mail : Multi recipient question <marnic@ludomedia.ch>
    Re: Need help with server / client perl scripts <partha@mihy.mot.com>
    Re: Pentium III Chips Released with IDs - Intel won't b <caisson@telebyte.nl>
        PERL and mySQL ("Adrian Fiorinni")
    Re: Perl Flatfile seach <ebohlman@netcom.com>
        Printing in different fonts. jambutter@my-dejanews.com
    Re: Printing in different fonts. <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Problem with readdir and sub directories <ebohlman@netcom.com>
        Regexp: split on ; but not on \; (Collin Rogowski)
    Re: Regexp: split on ; but not on \; <aeb@saltfarm.bt.co.uk>
    Re: Regexp: split on ; but not on \; (Bart Lateur)
    Re: Regexp: split on ; but not on \; suresh.kannan@EyeSeeEll.com
    Re: Regular Expressions (Bart Lateur)
    Re: split on meta question <partha@mihy.mot.com>
    Re: URGENT! Where Do You Hide The CGI Cards From The Sp (Bart Lateur)
        Web form using perl/cgi <thana@ti.com>
    Re: Web form using perl/cgi <Tony.Curtis+usenet@vcpc.univie.ac.at>
        without the awk! <robace@REMOVEvol.com>
    Re: without the awk! <michael.cameron@nospam.net.ntl.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 04 Mar 1999 12:55:08 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice Weekly ***
Message-Id: <36DE749C.66F74C6A@datenrevision.de>

Ilya Zakharevich wrote:
> 
> [A complimentary Cc of this posting was sent to Philip Newton
> <Philip.Newton@datenrevision.de>],
> who wrote in article <36DD5534.3CCBA728@datenrevision.de>:
> > I'm waiting for the entry that will answer "What is her last name?".
> 
> Why "her"?

Because "Abigail" is, to my knowledge, only a female given name. I
assumed it is Abigail's own given name, and hence, that Abigail is
female.

Cheers,
Philip


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

Date: Wed, 03 Mar 1999 14:33:47 +0000
From: Alan.Burlison@UK.Sun.COM (Alan Burlison)
Subject: [ANNOUNCE] "StatsView" Solaris OS stats viewer 1.0 released
Message-Id: <36DD484B.52214134@uk.sun.com>

    *** From dbi-users -- To unsubscribe, see the end of this message. ***

This is a multi-part message in MIME format.
--------------09BA6CF78041D990710A39EB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

WHAT IS IS IT?
--------------

StatsView is a Perl/Tk GUI-based tool for viewing the output of the
various Solaris utilities that produce system performance statistics. 
At the moment sar, iostat, vmstat and vxstat are supported.  In this
release the ability to collect statistics has been added, including the
collection and display of Oracle statistics.

StatsView offers the following features:

o Allows multiple data sources and graphs to be displayed simultaneously
o Supports both printing and saving of the graphs in a wide range of
  formats: Postscript, CGM, (Microsoft Office), MIF (FrameMaker), GIF
  and as CSV - useful for extracting data from sar files!
o Supports both binary (sar -o) and text (sar > file) sar data files.
o Allows the selection of which category of sar data is to be viewed,
  e.g. CPU, Paging, Disk I/O etc.
o Within a category, it allows the selection of individual data items
  e.g. for CPU data %usr, %sys, %wio and %idle are individually
  selectable.
o Supports iostat -x and vmstsat output, providing a header line is
  added to the start of the file.
o Has a GUI interface for statistics collection, allowing all the
  supported statistics to be collected in an ingegrated manner.

WHAT DOES IT REQUIRE?
---------------------
Perl5.005_02
Tk800.012
GnuPlot 3.7 (source is included in tarball)
optional - DBI and DBD::Oracle for Oracle statistics
optional - Solaris::MapDev and Solaris::Kstat for device name mapping
           and additional IO statistics

WHERE CAN I FIND IT?
--------------------

At any CPAN mirror under authors/id/ABURLISON, or directly from
http://www.cpan.org/authors/id/ABURLISON/StatsView-1.0.tar.gz

Alan Burlison
--------------09BA6CF78041D990710A39EB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


--------------09BA6CF78041D990710A39EB--



------------------------------------------------------------------------------
To unsubscribe from this list, please visit http://www.fugue.com/dbi
If you are without web access, or if you are having trouble with the web page,
please send mail to dbi-request@fugue.com.   Please try to use the web
page first - it will take a long time for your request to be processed by hand.
------------------------------------------------------------------------------


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

Date: Wed, 03 Mar 1999 14:16:23 +0000
From: Alan.Burlison@UK.Sun.COM (Alan Burlison)
Subject: [ANNOUNCE] Oracle tool "explain" 1.0 released
Message-Id: <36DD4437.8B709229@uk.sun.com>

    *** From dbi-users -- To unsubscribe, see the end of this message. ***

WHAT IS IT?
-----------

Explain is a GUI-based tool that enables easier visualisation of Oracle
Query plans.  A query plan is the access path that Oracle will use to
satisfy a SQL query.

Explain allows a user to interactively edit a SQL statemant and view the
resulting query plan with the click of a single button.  The effects of
modifying the SQL or of adding hints can be rapidly established.

Explain allows the user to capture all the SQL currently cached by
Oracle.  The SQL capture can be filtered and sorted by different
criterea, e.g. all SQL matching a pattern, order by number of executions
etc.

Explain is written using Perl, DBI/DBD::Oracle and Tk.

WHAT'S NEW IN THIS RELEASE?
---------------------------

Added ability to switch into a schema other than that of the logged-in
user
 - Menu option added to switch schema in explain window
 - Capture window now displays which user first executed the SQL
 - Automatic schema switch when SQL is copied from capture window into
   explain window
 - Added full username and schema name to window title
Fixed duplicated key bindings on menus

WHERE CAN I FIND IT?
--------------------

At any CPAN mirror, under authors/id/ABURLISON, or direct from
http://www.cpan.org/authors/id/ABURLISON/Explain-1.0.tar.gz

Alan Burlison


------------------------------------------------------------------------------
To unsubscribe from this list, please visit http://www.fugue.com/dbi
If you are without web access, or if you are having trouble with the web page,
please send mail to dbi-request@fugue.com.   Please try to use the web
page first - it will take a long time for your request to be processed by hand.
------------------------------------------------------------------------------


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

Date: Thu, 4 Mar 1999 14:48:19 +0300
From: "Michael Yevdokimov" <flanker@sonnet.ru>
Subject: Banner System
Message-Id: <7blrrd$pb0$1@bison.rosnet.ru>

Hello

Can anybody explain me how banner system's script works.

For example, I have the following code to include into my page:

<a href="http://www/bannerclick.cgi?id=18885/455">
<img src="http://www/bannershow.cgi?id=18885">
</a>

Every time when I reload my webpage 1st line is changed onto another onto
smth like:
<a href="http://www/bannerclick.cgi?id=18885/498">
or
<a href="http://www/bannerclick.cgi?id=18885/515">

i.e. number of banner is changed. How it works???

Simply I'd like to create a small banner system. The one script has to show
banner (I can do it), and the second has to change location according to
banner which is showed on the page. I can't understand how the number in 1st
line is changed....

If you can please give me any source of simple banner system which not need
in SSI (my site doesn't support SSI !!!). I have to click on link which will
belong to this banner! How to realize it??

Thanks in advance.

--
Best wishes,

Michael Yevdokimov

Email: flanker@sonnet.ru
ICQ: 30874618
-------------------------------------------------
>> Developers Support Site <<
Web: http://developer.tsx.org
http://www.basicnet.sonnet.ru
-------------------------------------------------





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

Date: 4 Mar 1999 08:59:09 GMT
From: "Sheila  Eugenio" <seugenio@man.amis.com>
Subject: client-side script to search files in the server
Message-Id: <01be661d$26048df0$2bbe10ac@amipnet>

Hello,
	I have a directory in my server where hundreds of text files will reside. 
I am planning to create a CGI that will enable the users to fetch the files
from their browsers but how can I do this?  This is my first time to create
a client side script. As far as I know,  using opendir will not work
because it will search the users local PC. Please help me. Thanks..



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

Date: 4 Mar 1999 10:28:25 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: date (week number)
Message-Id: <7bln89$6gg$1@solti3.sdm.de>

In article <36dd8d2d.1854504@news.online.ee>, Cim <cim@online.ee> wrote:

> I need to get current week's number (week 9 currently). It can be from
> the beginning of current year or from EPOCH. I have a separate data
> for each week and i need to display that data according to current
> week, next week and the one after that.
> Any ideas. Can localtime alone and/or special math help me. Any
> modules that could do it.

The solutions given in this thread so far are probably not compliant
with the relevant norms and standards.

See the Date::Manip and Date::Calc modules on CPAN, they include
routines for this which are compliant.

(Also see my sig below for URLs where to find these modules.)

Date::Calc is faster and more compact (it's written in C internally
and can be used as a library in C programs as well) and was written
with the UNIX philosophy (keep it simple, let it do only one task but
that one perfectly) in mind, whereas Date::Manip is more comfortable
(for instance it allows you to enter dates in natural language) but
rather huge (and it's written in plain Perl).

Date::Calc uses the official definition for week numbers from DIN 1355,
ISO/R 2015-1971 and ISO 8601, while Date::Manip also offers a special
unofficial north-american definition.

Hope this helps.

Regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/download/    (Free Perl and C Software
    http://www.perl.com/CPAN/authors/id/STBEY/         for Download)
    New: Build'n'Play 2.1.0 (all-purpose Unix batch installation tool)
    http://www.oreilly.de/catalog/perlmodger/bnp.html


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

Date: Thu, 04 Mar 1999 11:58:19 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Do you really need to do 'open(whatever, ..) or die..'
Message-Id: <36DE674B.FF04529D@datenrevision.de>

And read perlipc to find out why you probably need to set $SIG{'PIPE'}
if you're opening a pipe to write to.

Cheers,
Philip


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

Date: Thu, 04 Mar 1999 10:26:03 GMT
From: rnbernardo@yahoo.com
Subject: Help needed on pattern matching in reverse
Message-Id: <7bln3l$1cn$1@nnrp1.dejanews.com>

I was wondering if it's possible in Perl to do a pattern match in reverse
direction. For example,  m/foo/ searches for the first occurrence of 'foo'.
What I'd like is the search for the last occurrence.

Help is much appreciated.

Ray

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


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

Date: 04 Mar 1999 11:48:13 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Help needed on pattern matching in reverse
Message-Id: <83d82p8r9u.fsf@vcpc.univie.ac.at>

Re: Help needed on pattern matching in reverse,
rnbernardo <rnbernardo@yahoo.com> said:

rnbernardo> I was wondering if it's possible in Perl
rnbernardo> to do a pattern match in reverse
rnbernardo> direction. For example, m/foo/ searches
rnbernardo> for the first occurrence of 'foo'.  What
rnbernardo> I'd like is the search for the last
rnbernardo> occurrence.

TMTOWTDI

#17. search for all occurrences and pop() the last
one off the array returned.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Thu, 04 Mar 1999 11:28:50 GMT
From: brethel@dcc.unicamp.br
Subject: HELP: Socket based script under Win32
Message-Id: <7blqpc$4bv$1@nnrp1.dejanews.com>

Hi,
i'm doing a Socket based script to run under Win32, and
i don't know how to find out my machine's local IP
( dynamically assigned at each connection ); under
Unix i know'd be the $localhost=`hostname`, but how does that's
done in Windows 9x/NT ???

plz, any help would be ****greatly***** appreciated.

thx.

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


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

Date: Thu, 04 Mar 1999 12:09:22 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: How do i get the first 100 words from a paragraph
Message-Id: <36DE69E2.4019193D@ngb.se>

Kelby Valenti wrote:
> I am looking for a way to get the first one hundred from a given
> paragraph.

Primitive:

$paragraph =~ /((\S+\s){100}[^.]*\.)/;
$words = $1;

The problem whit this is that you dont get anything if $paragraph is
shorter than 100 words. So you could try

@words = split(' ', $paragraph);
$words = join(' ', @words[0..99]);

while(@words[100..$#words]){
	$words .= ' ' . $_;
	last if $_ =~ /\./;
}

But it is still crude... We allow the period to be in the middle of a
word, etc.

perlre, perlfunc, perlsyn, perlvar

HTH
Staffan


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

Date: Thu, 04 Mar 1999 09:03:52 +0100
From: Dirk Schumacher <Dirk.Schumacher@depot147.dpd.de>
Subject: Info4s about File::Find
Message-Id: <36DE3E68.C7EA8736@depot147.dpd.de>

Hi,

who can i find infos about File::Find ???

I have seen the perdoc File::Find, but there are no info4s about follow
links

How follows Find::Find sym. links ???


Thanks
Dirk Schumacher





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

Date: Thu, 04 Mar 1999 11:16:58 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Inserting a 'newline' in arrays?
Message-Id: <36df6acd.6492849@news.skynet.be>

Mick wrote:

>      print OUTFILE @outlines;
>
>So I'm creating a file called $user_name, and in that file is $date and
>$elapsed_time, this is fine, but, I have the values seperated by commas
>on one continual line!
>
>How do I force a \n after the $elapsed time but without placing a ','
>after the $elapsed_time?

	$\ = "\n";
	foreach (@outlines) {
		print OUTFILE;
	}

	Bart.


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

Date: Thu, 04 Mar 1999 08:52:33 GMT
From: johnny99@sydney.dialix.oz.au
Subject: Looking for a spider script
Message-Id: <7blhke$t68$1@nnrp1.dejanews.com>

Where I work, we have a big site (in the fifty to one hundred thousand pages
range) and I'd very much like to have a perl script that could do a full
search of the site: not a search engine, just a listing of all documents and
directories, and some useful stuff like document sizes and last-modified
dates.

This must be possible, but, I can't seem to find it by searching at the usual
places.

Anyone got an idea?

--
I'll have this thing looking like the Mac in no time!

Neil Kontzen, Windows Developer, 1984

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


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

Date: Thu, 04 Mar 1999 11:31:50 +0100
From: Marc Nicole <marnic@ludomedia.ch>
Subject: Mail : Multi recipient question
Message-Id: <36DE6116.78E24D27@ludomedia.ch>

Hi,

I have to send emails to multiple recipients. 

my question is the folowing :

does someone know the limits of methods 1 and 2 ?

1) using 'Bcc:' (or 'Cc:')

    open(MAIL,"|/usr/lib/sendmail -t");
    ...
    foreach $recipient (@recipient) {  print MAIL "Bcc: $recipient\n"; }
    ...
    close (MAIL);

2) using only 'To:'

    foreach $recipient (@recipient) 
    {
      open(MAIL,"|/usr/lib/sendmail -t");
      ...
      print MAIL "To: $recipient\n"; }
      ...
      close (MAIL);
    }

thanks,

Marnic
_____________________________________________________________________

  L  U  D  O  M  E  D  I  A                   http://www.ludomedia.ch
  -------------------------                 Phone: ++ 41 21 311.60.93
  G A M E   -   D E S I G N                mailto:marnic@ludomedia.ch
_____________________________________________________________________


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

Date: Thu, 04 Mar 1999 16:31:36 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: Fred <fredrick@smacked.com>
Subject: Re: Need help with server / client perl scripts
Message-Id: <36DE6810.E4786CFB@mihy.mot.com>

Fred wrote:

> Does anyone know of any client / server perl programs that allow the
> client to execute certain commands on the remote host?
> Thanks

  I'm not sure if such a PERL script exists. But JAVA provides such a
feature inherently - RMI (Remote Method Invocation).

HTH
-Partha



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

Date: 4 Mar 1999 08:19:24 GMT
From: "Caisson" <caisson@telebyte.nl>
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <01be6618$21457180$deddebc2@default>

paul milligan <pjm@see_my_sig_for_address.com> schreef in artikel
<36e08964.75304572@news.concentric.net>...

Hello Paul,

> redsky@ibm.net (Thane Hubbell) pondered briefly, and wrote:
> 
> 	{ post list allowed, because this aspect does relate across
> platforms / groups, IMO }
> 
> >I mentioned in a earlier message that I wrote a copy protection scheme
> >for my software based on BIOS data and machine type.  This was a 
> >FIASCO from day one, as users would change machines, upgrade machines 
> >etc.  Trying to ID a PERSON from a CPU ID is nuts.  The best you can 
> >do is ID the CPU.  This will be a good thing for software licenses - 
> >to an individual CPU.  I see this coming, actually, from MicroSoft.  
> >Buy Windows 98/2000 and install it on "THIS" CPU - but no other.  
> 
> 	Certainly do-able, and likely to happen ( not just Windows,
> but all platforms / languages ).
> 
> >Great for software sales.  But as a method to ID a particular 
> >consumer?   Not a chance.
> 
> 	Do you license a person or a copy ( therefore one machine ) ?
> Personally, I license per copy, not per person.  You want to run it on
> another machine, you buy another ( discounted ) license.

So, You are telling me that if I buy some software, use it on some machine,
upgrade (downgrade ?) to some other machine I have to pay again ?  Nice
move !  No wonder Unix is winning terrain ...

Greetz,
  Rudy Wieser



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

Date: Thu, 04 Mar 1999 03:46:40 -0800
From: grumetedapanair@hotmail.com ("Adrian Fiorinni")
Subject: PERL and mySQL
Message-Id: <souD2.1563$xv.13215656@WReNphoon2>

trust me, there's something *very* weird on your
where='admin'; "where" WHAT "='admin'" ???

check the docs once more; guess u missed a column
name there...

( i haven't used mySQL, my - sad - experience is
with mSQL... anyway, the "where" is not being matched )

hope it helps

good luck !



*** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ***


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

Date: Thu, 4 Mar 1999 08:50:55 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Perl Flatfile seach
Message-Id: <ebohlmanF82B8w.8t4@netcom.com>

carys <carys@indigo.ie> wrote:
: When the *.pl file runs it will always give me Your search has not been
: found try again etc.
: The problem is more than likely within the Do_Search sub.

: I have written the warnings I've been getting using -w in comments within
: the program.
: I cant get to grips with the -d debugging procedure,

perldoc perldebug

: and I'm having trouble
: finding places to be told things like the simple syntax and uses for while()
: and if() statements.

perldoc perlsyn

: #!/perl/perl.exe -w

+1 brownie point for -w.  -1 brownie point for no 'use strict;'.

: require "html.pm"; # contains HTML_Header and _Footer

: # uninitialised values on line below? thought I was initialising (or
: declaring)
: # an array which had the following elements.

: @headings =
: ($Title,$Subsection,$Course,$Duration,$Full-time,$Part-time,$Entry,$Comments
: );

You've tried to initialize an array with the contents of 8 scalar 
variables, none of which have been set to anything.  It turns out that 
you fill the array up later in the code, so you don't need to initialize 
it with anything.

: $datafile = "DCU.txt";

: $SearchString = $ENV{'QUERY_STRING'};

:  # another uninitialised value here?
:  ($tag,$search) = split (/=/, $SearchString);

It's possible that $ENV{'QUERY_STRING'} was empty or didn't have two 
strings separated by an '='.

: &Do_Search;
: $count=@matches;

: &No_Matches if($count == 0);
: &Print_Results;
: exit;

: sub Do_Search{
:  open(DATAFILE,"$datafile");

:  # says I'm reading on closed file handle
:  # here though I opened it with previous line of code.

No, you *thought* you opened it with the previous line of code.  You 
never checked to see if you succeeded.  It's quite likely that your HTTP 
server is running your CGI script in a different directory than you expect.

open(DATAFILE,$datafile) or die "Can't open $datafile: $!";

:  while(<DATAFILE>){
:   if(/$search/i){
:    push @matches, $_;
:   } # End of if.
:  } # End of while.
:  close(DATAFILE);
:  return;
: } # End of Do_Search subroutine.


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

Date: Thu, 04 Mar 1999 11:01:55 GMT
From: jambutter@my-dejanews.com
Subject: Printing in different fonts.
Message-Id: <7blp70$34k$1@nnrp1.dejanews.com>

I'm editing a Perl script that creates a report, and want to print the header
of the report in a different font to the rest of the script (i.e. bold and
bigger font).

Can someone tell me how to do this?

The existing file has 'push(@ARGV, " FONT: -f Courier6");'.
I've tried looking this up in the Perl books but can't find anything.

Any help would be appreciated.

Thanks.

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


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

Date: 04 Mar 1999 12:15:11 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Printing in different fonts.
Message-Id: <83bti98q0w.fsf@vcpc.univie.ac.at>

Re: Printing in different fonts., jambutter
<jambutter@my-dejanews.com> said:

jambutter> I'm editing a Perl script that creates a
jambutter> report, and want to print the header of
jambutter> the report in a different font to the
jambutter> rest of the script (i.e. bold and bigger
jambutter> font).
jambutter> Can someone tell me how to do this?

Depends on your output device doesn't it?

Nothing to do with perl, perl outputs whatever you
tell it to.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Thu, 4 Mar 1999 08:16:39 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Problem with readdir and sub directories
Message-Id: <ebohlmanF829nr.73C@netcom.com>

pault2000@my-dejanews.com wrote:
: I am writing a script (well, trying) that will put all of the files in a
: folder into an array and then do some regular expression stuff,etc.. I have
: sussed out the expressions (it was nearlt the death of me) but I am stuck
: trying to get the file names from the sub directories. The script below is an
: example of where I have been with this. It gladly prints the sub directory
: names but I need some pointers on taking it one step further so that I can
: get into all the following folders.

perldoc File::Find.  After reading it, I suspect you'll find (hehe) the 
task a lot simpler.



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

Date: Thu, 04 Mar 1999 10:31:33 GMT
From: collin@rogowski.de (Collin Rogowski)
Subject: Regexp: split on ; but not on \;
Message-Id: <36de60ad.86493891@news.uni-X.net>

How can I split a String at ; but not at \;
I tried some weird things with ?! but it didn't work.

thanks,

Collin Rogowski


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

Date: 04 Mar 1999 11:16:05 +0000
From: Tony Bass <aeb@saltfarm.bt.co.uk>
Subject: Re: Regexp: split on ; but not on \;
Message-Id: <rgn21t5wui.fsf@calf.saltfarm.bt.co.uk>

collin@rogowski.de (Collin Rogowski) writes:


> How can I split a String at ; but not at \;
> I tried some weird things with ?! but it didn't work.

Perhaps something on the lines of

   m/((?:\\.|[^\\;])+)/g

in list context.

-- 
# A E Bass                                      Tel: (01473) 645305
# MLB 3/19, BT Laboratories                     e-mail: aeb@saltfarm.bt.co.uk
# Martlesham Heath, Ipswich, Suffolk, IP5 3RE   Do not rely on From: line
#                                               Opinions are my own


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

Date: Thu, 04 Mar 1999 11:21:28 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Regexp: split on ; but not on \;
Message-Id: <36e06b97.6694533@news.skynet.be>

Collin Rogowski wrote:

>How can I split a String at ; but not at \;
>I tried some weird things with ?! but it didn't work.

Maybe not using split?

	@part = /(?:\\;|[^;])+/g;

	Bart.


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

Date: 4 Mar 99 11:23:14 GMT
From: suresh.kannan@EyeSeeEll.com
Subject: Re: Regexp: split on ; but not on \;
Message-Id: <36de6d22.0@145.227.194.253>

Collin Rogowski <collin@rogowski.de> wrote:
> How can I split a String at ; but not at \;
> I tried some weird things with ?! but it didn't work.

> thanks,

> Collin Rogowski

Assuming you're reading from stdin,
You could try something along the lines of:

while (<>)	{
	@a = split(/([^\\];)/);
	foreach $i (0..$#a/2){
		$a[2*$i+1] =~ s/;//g;
		print $a[2*$i] . $a[2*$i+1] ."\n"}
}

This will print out each chunk.
Of course, you'll need to modify this as appropriate..

HTH

-----
To get my email address substitute letters for spelt out equivalent.


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

Date: Thu, 04 Mar 1999 10:21:17 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Regular Expressions
Message-Id: <36e059a1.2110328@news.skynet.be>

Mario Schomburg wrote:

>does anyone know a possibility to generate a regular expression
>for a couple of strings?
>I would like to provide these strings to a function which will
>return a regular expression matching all these strings.

Perhaps something like:

	#! perl -w
	$_ = "th'other";

	@string = qw(this that th'other);
	$pattern = join('|', map { "\Q$_\E" } @string);
	print STDERR "Pattern: /^($pattern)\$/\n";
	if (/^($pattern)$/o) {
		print "match: $1\n";
	} else {
		print "no match\n";
	}

	Bart.


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

Date: Thu, 04 Mar 1999 16:35:02 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: George Collins <gcollins@mnsinc.com>
Subject: Re: split on meta question
Message-Id: <36DE68DE.53525FC5@mihy.mot.com>

George Collins wrote:

> I need to split some text delineated with the "|" and "." characters. I
> understand the meta-ness of such characters and the need to escape or
> quote them when used in a literal sense, but I've not been able to get
> perl's split to do "what I expect", despite trying several of the
> builtin quoting functions (\0nnn,\0xnn, \Q, \, qw()). I currently have
> hideous work-around in place that I'd really like to remove before
> anyone notices. I'm trying do something like:
>
> ($a, $b, $c)=split( "\.", "a.b.c" ) or
> ($a, $b, $c)=split( "\|", "a|b|c" )

  You already have some answers. Just to add to them, it looks good using
($a, $b, $c) = split(/[\.\|]/, "any-string");

Add the limit parameter (perldoc -f split) if required.

HTH
-Partha



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

Date: Thu, 04 Mar 1999 11:05:35 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: URGENT! Where Do You Hide The CGI Cards From The Spiders?
Message-Id: <36de6200.4250206@news.skynet.be>

tatabu@my-dejanews.com wrote:

>When we use a CGI script to create greeting cards for people,
>we usually create the cards in a directory, say "cards", which can
>be accessed by anybody. If this is the case, then the search engines
>that spider our pages can actually suck in all the confidential
>greeting cards that have been created. What do we do to
>remedy this?

I've been watching this thread for a while, and it looks like the bulk
of the replies you'll get, are nonsense. So here's my contribution.

If your provider allows it, you should put your data in a directory
outside your web space. It would be the most sensible. But even I have
had troubles with a provider that refused to do this, *everything* in my
space on the server is online, and it would cost *a lot* of extra money
to make him change that. As he deliveres excellent quality (speedwise),
and the data isn't *that* top-secret, we didn't change providers.

Next, you should experiment with a ".htaccess" file. Ideally, it should
be possible to put a "deny from all" line there. But my server didn't
accept that. So I ended up with using "require valid-user", and creating
one user, with a password.

Spiders won't be able to access the directory, and people will have to
guess the username and password. Very unlikely, especially if the
password is a random one.

This is the structure of my ".htaccess" file:

  AuthName "giveitaname"
  AuthType Basic
  AuthUserFile /absolute/path/here/.htpasswd
  <limit GET POST>
  require valid-user
  </limit>

And this is basically how I created my ".htpasswd" file:

  # pick something really unguessable here:
  ($user,$pwd)=("username","password"); 

  # print "Content-type: text/plain\n\n"; # Only if print to browser
  ($\,$,) = ("\n",':');
  print $user,crypt($pwd,'zx');


You'll have to do this on the server, because crypt() can give different
results on different machines, and you need the version as used by that
machine. Run this script once, delete the script afterwards. Either save
the output directly to the file, or send it to the browser, and copy the
result to the final file. 

   HTH,
   Bart.


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

Date: Wed, 03 Mar 1999 18:30:11 -0800
From: Thana Letchumi <thana@ti.com>
Subject: Web form using perl/cgi
Message-Id: <36DDF033.7E42@ti.com>

Hi,

   I'm using perl5.0001 with cgi script to develop web forms. I display
records on the web form for update. The records are kept in perl dbm
format. I need to add input type "submit" called "Next" to display the
next range of data on the same form. How do I call back the same perl
program which display the same page with different group of record
display ?. Can this be done ?. 
  
 I also need to refresh some forms automatically on certain interval.
 How can I do this ?

 Hope someone could help me since it is very important for my web
development using perl/cgi.
 Thank You.

 Regards,
 Thana


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

Date: 04 Mar 1999 11:47:04 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Web form using perl/cgi
Message-Id: <83emn58rbr.fsf@vcpc.univie.ac.at>

Re: Web form using perl/cgi, Thana <thana@ti.com>
said:

Thana> Hi, I'm using perl5.0001 with cgi script to

Oh dear, I would advise upgrading ASAP.

Thana> develop web forms. I display records on the
Thana> web form for update. The records are kept in
Thana> perl dbm format. I need to add input type
Thana> "submit" called "Next" to display the next
Thana> range of data on the same form. How do I call
Thana> back the same perl program which display the
Thana> same page with different group of record
Thana> display ?. Can this be done ?.
  
Thana>  I also need to refresh some forms
Thana> automatically on certain interval.  How can I
Thana> do this ?

Thana>  Hope someone could help me since it is very
Thana> important for my web development using
Thana> perl/cgi.  Thank You.

These are all purely WWW / CGI / HTTP questions,
there's nothing really to tie them into one
particular programming language.

You'll get more positive responses in e.g.

   news:comp.infosystems.www.authoring.cgi
   news:comp.infosystems.www.authoring.html

If you have problems in doing this *in perl*, e.g.

   how do I self-reference a URL in CGI.pm ?

then post your code (or pertinent snippets thereof)
and you might feel justified in posting here.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Thu, 4 Mar 1999 02:47:34 -0500
From: "Robert Acklin" <robace@REMOVEvol.com>
Subject: without the awk!
Message-Id: <WTqD2.193$bH4.862@news12.ispnews.com>

How would I do the following:
but without the awk!

foreach $dirname ( `smbclient $smbcmd | grep "Disk" | awk '{print $3}' ` )


    $dirname =~ tr /A-Z/a-z/;
    &do_thing;
  }

TIA
Rob




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

Date: Thu, 04 Mar 1999 09:15:15 +0000
From: Michael Cameron <michael.cameron@nospam.net.ntl.com>
To: Robert Acklin <robace@vol.com>
Subject: Re: without the awk!
Message-Id: <36DE4F23.D1518422@nospam.net.ntl.com>

Robert Acklin wrote:

> How would I do the following:
> but without the awk!
>
> foreach $dirname ( `smbclient $smbcmd | grep "Disk" | awk '{print $3}' ` )
>
>     $dirname =~ tr /A-Z/a-z/;
>     &do_thing;
>   }
>
> TIA
> Rob

How about:

foreach $input_line ( `smbclient $smbcmd`) {
    next unless $input_line =~ /Disk/;
    (undef,undef,$dirname) = split(' ', $input_line);
    $dirname =~ tr /A-Z/a-z/;
    do_thing();
  }

As always, this is only one possible solution.

Your example has several bugs in it including no opening { and the $3 in your
system call.  Try posting a real example, it makes things much easier.

HTH,

Michael



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

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

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