[8178] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1795 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 3 10:12:06 1998

Date: Tue, 3 Feb 98 07:00:42 -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           Tue, 3 Feb 1998     Volume: 8 Number: 1795

Today's topics:
    Re: [perl] accept a char at a time without.. <friedman@uci.edu>
    Re: A regex problem <jdporter@min.net>
        beyond my abilities <branning@access.digex.net>
    Re: boston.pm.org (Chris Nandor)
        clarifying error messages (Lynchqvctc)
        Curses example peter.edlund@capgemini.se
    Re: Deleting directories mgscheue@io.com
    Re: help with multi-line regexp subsitution (Clay Irving)
        Help writing to log file and redirecting user (Bob)
        Help! ~ operator doesn't work! <slg@mycroft.cmhnet.org>
    Re: how to replace bad characters in a string with a sp <friedman@uci.edu>
    Re: how to replace bad characters in a string with a sp <westxga@ptsc.slg.eds.com>
        Inverse of a regex (Doug)
    Re: Inverse of a regex <wahl@lts.sel.alcatel.de>
    Re: Inverse of a regex peter.edlund@capgemini.se
    Re: Inverse of a regex <westxga@ptsc.slg.eds.com>
    Re: Is There a Way to Switch the case Sensitivity of Pa <barnett@houston.Geco-Prakla.slb.com>
        LOW LEVEL PERL HELP <mcai3ph2@ist4.co.umist.ac.uk>
        LOW LEVEL PERL HELP <mcai3ph2@ist4.co.umist.ac.uk>
        LOW LEVEL PERL HELP <mcai3ph2@ist4.co.umist.ac.uk>
        LOW LEVEL PERL HELP <mcai3ph2@ist4.co.umist.ac.uk>
        LOW LEVEL PERL HELP <mcai3ph2@ist4.co.umist.ac.uk>
        Math Floor and Ceiling Function <denewman@cs.buffalo.edu>
    Re: Math Floor and Ceiling Function (Chris Nandor)
    Re: Math Floor and Ceiling Function <xxTony.Curtis@vcpc.univie.ac.at>
    Re: Math Floor and Ceiling Function (Clay Irving)
    Re: Module design question (use Exporter vs require Exp <friedman@uci.edu>
    Re: Multi-line blocks of text <alphen@craxx.com>
        New core dump on long-working troff2html <jspath@mail.bcpl.lib.md.us>
        Outlook and perl <stanleyng@cheerful.com>
    Re: Passing URL to Browser from Script (Clay Irving)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 3 Feb 1998 14:07:53 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: [perl] accept a char at a time without..
Message-Id: <6b78bp$n1c@news.service.uci.edu>

In article <6b69r1$m072@id4.nus.edu.sg>,
wakaranai  <khoohuit@iscs.nus.edu.sg> wrote:
<	hi!
<	how do i accept a char input without having to press the
<	enter key in perl?

hi!
how do i get you to read the faq without having to press the keys
for you?

HTH,
Eric

<	i am implementing a text based GUI which requires key movements
<	like TAB and ARROW keys....any gurus out there? thanks!
<
<-- 
<"The human intellect has permitted the appearances to shine forth and
< has infused all things with its own basic misconceptions..."
<							- Nietzsche


-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Tue, 03 Feb 1998 09:18:38 -0500
From: John Porter <jdporter@min.net>
Subject: Re: A regex problem
Message-Id: <34D7273E.25C6@min.net>

Kari Marttila wrote:
> 
> Is there a way to remove certain tags inside another tags? E.g.
> ...
> remove all "<p>" tags only if they were
> inside a string delimited by "<H3>..</H3>" tags.
> 
> I have tried several ways without success.

In general if you're munging HTML, you should use the HTML
modules, such as HTML::Parse.  Then you can traverse the
tree which represents the structure of the html document,
and eliminate the tags (nodes) you don't want.

hth,
John Porter


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

Date: Tue, 03 Feb 1998 08:57:32 -0500
From: Daniel Branning <branning@access.digex.net>
Subject: beyond my abilities
Message-Id: <34D7224B.AB1D3FFD@access.digex.net>

I was very excited to see the following post to this newsgroup, as it
solves a problem which I have been struggling with for some time -- and
so I got the Sort::Fields module and installed it on my Linux box at
home with no problems.

At work, however, I am using the ActiveWare port to Win32 (5.003_7 Build
315 - with an MKS Toolkit shell), and I've stumbled into several issues
which are beyond my abilities at this point.

First, I couldn't install the module with the Makefile.PL ...
    - Can't locate ExtUtils/MakeMaker.pm in @INC at Makefile.PL line 1)
    - ... and <perl -e "print \"@INC\n\""> returns nothing.
So I manually put the Fields.pm module in a new \lib\Sort\ directory and
ran the example in the posting, and now I get:
    - syntax error at C:\perl\lib/Sort/Fields.pm line 56, near "->("
    - syntax error at C:\perl\lib/Sort/Fields.pm line 57, near "->("

Any help would be very much appreciated, as I suspect that there are
several things going on here.


> Subject: Re: Help with SORT
> Date: Thu, 29 Jan 1998 00:01:04 -0700
> From: "Joseph N. Hall" <joseph@5sigma.com>
> Organization: 5 Sigma Productions (http://www.effectiveperl.com)
> Newsgroups: comp.lang.perl.misc
>
> First, note that as numbers, 1.1 and 1.10 are the same thing.
>
> Here's an option (using my shiny new Sort::Fields module):
>
> use Sort::Fields;
> my @list = qw(0 1 1.1 1.10 1.2 2.1 2 0.1);
> {
>     local $^W;  # otherwise "0", "1" etc will generate warnings
>     print join " ", fieldsort q/\./, ['1n', '2n'], @list;
> }
> ....



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

Date: Tue, 03 Feb 1998 08:31:54 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: boston.pm.org
Message-Id: <pudge-0302980831550001@ppp-5.ts-1.kin.idt.net>

Alright, it is official.  We will be meeting this Saturday night at 7
p.m.  Join the mailing list or e-mail me for more info (we need to know
how many people are coming).

   majordomo@twinlights.org
   subscribe boston-pm

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==       New Book: MacPerl:  Programming for the Rest of Us       ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: 3 Feb 1998 14:50:57 GMT
From: lynchqvctc@aol.com (Lynchqvctc)
Subject: clarifying error messages
Message-Id: <19980203145001.JAA05854@ladder02.news.aol.com>

I have a program now running on a win95 system-- a searchable database of
historical pictures. In trying to set the same program up on another win95
machine, with the same file structure etc., the program does not run. The
generated error message reads:

"No DBM package was successfully found or installed at
C:\Sambar4\perl\lib/AnyDBM_File.pm line 11. BEGIN failed--compilation aborted
at pictutil.pl line 5."

Both systems have the same version of perl... both have the AnyDBM_File.pm
module....
I am assuming that the message IS finding AnyDBM_File.pm, but is not able to
find the "DBM package"  -- how do I find out what this means? Is it, for
example, not able to find the actual database referred to in my program, or not
able to find the ODBC driver... or? 
It is a vexing problem... after working long and hard getting it to run on one
system.... finding some little glitch (or not finding it as the case may be)...
any constructive suggestions are welcome.
Thank you.
Brian


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

Date: 3 Feb 1998 13:33:39 GMT
From: peter.edlund@capgemini.se
Subject: Curses example
Message-Id: <6b76bj$3fn$1@news.capgemini.se>


If anyone know where I can lay my hands on a good example of using the Curses module, I'd be happy.

//peter.
-- 
-------------------------
Peter Edlund
UNIX development engineer
Cap Gemini
peter.edlund@capgemini.se


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

Date: Tue, 03 Feb 1998 08:21:55 -0600
From: mgscheue@io.com
Subject: Re: Deleting directories
Message-Id: <6b7963$k6f$1@nnrp2.dejanews.com>

In article <34D50E06.D8A1E43D@ici.net>,
  davew@ici.net wrote:

> I'm trying to delete a directory that has files in it. I have
> "Programming Perl", "Learning Perl", "CGI Programming with Perl", and
> "Perl for Dummies". Each one has a short statement that simply says Perl
> will only delete directories without any files in them. Is there a way?
> Or, how can I delete files within a known directory without knowing the
> file names. The names will be generated later by users.

use File::Path;
rmtree('/your/dir/here');

This will remove all files below /your/dir/here and the directory itself.

Mark


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 3 Feb 1998 09:16:51 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: help with multi-line regexp subsitution
Message-Id: <6b78sj$im4@panix.com>

In <34D64250.795C@intnet.net> "Hugh J. Blair" <blairhj@intnet.net> writes:

>Help !  I'm a perl newbie so this could make or break my perl career.
>I'm trying to extract multi-line block of text from a very large file.
>I can specify the begin pattern and the end pattern. The variation is a
>string in the middle.
>Any help will be greatly appreciated.

You're in the wrong newsgroup -- alt.mindreading.programmers is down the hall
to the left.

Seriously, how can anyone help if you don't post an example of what you are
trying to do? 

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: Tue, 03 Feb 1998 14:39:09 GMT
From: miadesigns@thetriangle.com (Bob)
Subject: Help writing to log file and redirecting user
Message-Id: <34d72a93.633601540@news.mindspring.com>

Hi,

What I'm trying to accomplish is similar to a guest book script. Here
are the details:

  -a user is presented with a form (login2.htm)
  -the form invokes 'presskit7.pl' (your script, somewhat modified)
  -the script appends the form contents to a log file
  -the script redirects the user to a new page, not the log file

Though I'm not by any means a Perl programmer, I tried making
modifications to a sample script to make the above possible. At first
I thought I was making some progress, but then I could either get the
log to be updated or the redirection to occur, but not both. :(

(The sample code is below)

I'm stumped! Can someone offer any assistance? Something I did is just
not clicking.

Thanks for any help

Bob

--------------------------------------------------
#!/usr/bin/perl
#
######################

# path to log file 
$guest_log = "presskit.htm";


################### End of configuration section
########################

# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

# Split the name-value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs) {
   ($name, $value) = split(/=/, $pair);

   # Un-Webify plus signs and %-encoding
   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $value =~ s/<!--(.|\n)*-->//g;
   $value =~ s/<([^>]|\n)*>//g;   

   $FORM{$name} = $value;
} 

if ($FORM{'new'}){
	&no_name unless $FORM{'Contact_FirstName'};
	&no_lastname unless $FORM{'Contact_LastName'};
	&no_title unless $FORM{'Contact_Title'};
	&no_organization unless $FORM{'Contact_Organization'};
	&no_phone unless $FORM{'Contact_WorkPhone'};
	&no_email unless $FORM{'Contact_Email'};
	&no_valid_email unless (($FORM{'Contact_Email'} eq '') ||
(($FORM{'Contact_Email'} ne '') && 
		($FORM{'Contact_Email'} =~ /\w*@\w*/))); 
}

print "Content-Type: text/html\n\n";


$quit = 0;
while ($quit != 1) {

   # If lockfile exist, then someone is already writing to the file
   if (-e "add.filelock") {
      # We'll take a 1 second nap
      sleep(5);
   }
   else {
      # Now we're cooking ...
      # Create a lock file
      open(LOCK, ">add.filelock");
      close LOCK;

		if ($FORM{'new'}){    #We have a new entry

		open(GUESTLOG, "$guest_log") || die "Couldn't open
$guest_log";
		@FILE = <GUESTLOG>;
		close(GUESTLOG);
			print GUESTLOG "Content-Type: text/plain\n\n";
		open(GUESTLOG, ">$guest_log") || die "Couldn't open
$guest_log";

			print GUESTLOG
"<B>$FORM{'Contact_FirstName'}<BR>";
			print GUESTLOG
"$FORM{'Contact_LastName'}</B><BR>";
			print GUESTLOG
"$FORM{'Contact_Title'}</B><BR>";
			print GUESTLOG
"$FORM{'Contact_Organization'}</B><BR>";
			print GUESTLOG
"$FORM{'Contact_WorkPhone'}</B><BR>";
			print GUESTLOG
"$FORM{'Contact_Email'}</B><BR>";
			print GUESTLOG "<HR>\n";

			print GUESTLOG @FILE; 

		close(GUESTLOG);



		      ######## Subroutines ########### 


sub no_title {
   print "Content-type: text/html\n\n";
   print "<html><head><title>No Title</title></head>\n";
   print "<body><h1>Your Title appears to be blank.</h1>\n";
   print "  Please use the <B> BACK BUTTON</B> on your browser to Go
Back\n";
   print " and enter your title.<p>\n";
   print "\n</body></html>\n";

   exit;
}


sub no_organization {
   print "Content-type: text/html\n\n";
   print "<html><head><title>No Organization</title></head>\n";
   print "<body><h1>Your Organization appears to be blank.</h1>\n";
   print "  Please use the <B> BACK BUTTON</B> on your browser to Go
Back\n";
   print " and enter your organization.<p>\n";
   print "\n</body></html>\n";

   exit;
}

sub no_name {
   print "Content-type: text/html\n\n";
   print "<html><head><title>No Name</title></head>\n";
   print "<body><h1>Your Name appears to be blank.</h1>\n";
   print "  Please use the <B>BACK BUTTON</B> on your browser to Go
Back\n";
   print " and enter your name.<p>\n";
   print "\n</body></html>\n";

   exit;
}

sub no_phone {
   print "Content-type: text/html\n\n";
   print "<html><head><title>No Work Phone </title></head>\n";
   print "<body><h1>Your Work Phone number appears to be
blank.</h1>\n";
   print "  Please use the <B> BACK BUTTON</B> on your browser to Go
Back\n";
   print " and enter your work phone number.<p>\n";
   print "\n</body></html>\n";

   exit;
}


sub no_lastname {
   print "Content-type: text/html\n\n";
   print "<html><head><title>No Last Name</title></head>\n";
   print "<body><h1>Your Last Name appears to be blank.</h1>\n";
   print "  Please use the <B>BACK BUTTON</B> on your browser to Go
Back\n";
   print " and enter your last name.<p>\n";
   print "\n</body></html>\n";

   exit;
}

sub no_email {
   print "Content-type: text/html\n\n";
   print "<html><head><title>No Email Address</title></head>\n";
   print "<body><h1>Your Email Address appears to be blank</h1>\n";
   print "Please use the <B> BACK BUTTON</B> on your browser to Go
Back\n";
   print " and enter your Email Address.<p>\n";
   print "\n</body></html>\n";

   exit;
}

sub no_valid_email
{
   print "Content-type: text/html\n\n";
   print "<html><head><title>Invalid E-Mail Address</title></head>\n";
   print "<body>\n";
   print "<h2>Invalid E-Mail Address</h2>\n";
   print "You must specify a valid email address.\n";
   print "Please use the <B> BACK BUTTON</B> on your browser to Go
Back\n";
   print " and enter your Email Address.<p>\n";
   print "</body></html>\n";

   exit;
}

##############


	# Unlock the file
      unlink("add.filelock"); 

	 # We are quitting the loop
      $quit = 1;

	 } ## end if

} ## end while


#### Redirect to PressKit Area ####


$page="../news/presskit.html";
## print "Content-type: text/html\n\n";
open (PAGE, "$page") || die "Couldn't open $page";
while (<PAGE>) {print;}
## print "Location: $page\n\n\n";
exit;
}



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

Date: Tue, 03 Feb 1998 09:28:08 -0500
From: Sean Gilley <slg@mycroft.cmhnet.org>
Subject: Help! ~ operator doesn't work!
Message-Id: <34D72978.7C64ADF2@mycroft.cmhnet.org>

I'm trying to get perl installed and working on a Tandem machine
running some version of System 5.4.0.

I've been having problems with tests failing. Yesterday we finally
tracked at least quite a few of the problems down to the ~ operator.
In experimenting with the bop.t test, we found that this statement:

	printf("%x\n", ~0xdead);

returned the value 7FFFFFFF.  Further, replacing "0xdead" with "1",
"111", and "111111", all yielded the result "7FFFFFFF".

A C program printing the same values returns results that are at least
all different; I didn't check for correctness.

Am I missing some configuration option?  Have I screwed up somewhere?
Is there anyone out there who can point me toward something that might
be a solution?

I'd really appreciate anyone who could help me get this resolved.

Sean.
sgilley@netexp.net
slg@mycroft.cmhnet.org


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

Date: 3 Feb 1998 14:02:59 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: how to replace bad characters in a string with a space?
Message-Id: <6b782j$n00@news.service.uci.edu>

In article <milagro-ya02408000R0302980327200001@news.erols.com>,
milagro <milagro@beanfield.com> wrote:

<foreach $rec  (@records)
<{
<$count++;
<
< pos($rec) = 0;
<    if ($rec =~ /[\000-\011\013\014\020-\37]/g) 
<            {
<     print "Bad character at position " . pos($rec) . " in record $count. ";
<      
<      #need to replace the bad character with a space here. How?

Why not just do the substitution? s/[\000-\011\013\014\020-\37]/ /g
Since you're trading characters one for one, however, tr/// (possibly
with a /s) would be a better solution.
If you absolutely must do a pattern match & the replace with the position
index, you could use substr().

HTH,
Eric



-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Tue, 03 Feb 1998 09:24:30 +0000
From: Glenn West <westxga@ptsc.slg.eds.com>
Subject: Re: how to replace bad characters in a string with a space?
Message-Id: <34D6E24E.1BAC@ptsc.slg.eds.com>

milagro wrote:
> 
> I currently have a script (which I received help for right here -- thank
> you very much) that looks for a series of control characters and tells me
> when it finds one and where it found it. What I now need to do is replace
> the "bad" characters I find with spaces (" "). My questions is: after I
> find the location and record where the bad character exisits, how do I
> replace those characters with a space (or anything for that matter).
> Do I use  "s/what here?/ /g;" ?
> Example.. if the output from below tells me I have bad characters at
> postions 234 and 998 in Rec 12. How do I go to position 234 and 998 and
> change those characters to spaces?
> 
> Thanks.. as always for any advice and help.
> 
> foreach $rec  (@records)
> {
> $count++;
> 
>  pos($rec) = 0;
>     if ($rec =~ /[\000-\011\013\014\020-\37]/g)
>             {
>      print "Bad character at position " . pos($rec) . " in record $count. ";
> 
>       #need to replace the bad character with a space here. How?

	substr($rec,pos($rec)-1,1)=' ';

> }
> 
> Sincerely
> Michael Shavel
> mshavel@erols.com


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

Date: Tue, 03 Feb 1998 18:36:26 GMT
From: doug@1dlabs.com (Doug)
Subject: Inverse of a regex
Message-Id: <6b6rv4$4a0$1@acdc.3dlabs.com>

Hi,
   I want to strip out the bracketed part of an email address (or html
tags come to think of it).   The line I have is 

$line = "From: Fred Bloggs <fred.bloggs@network.com>"

and if I use 

$line =~ s/(\<.*?\>)//g;

I get the result

From: Fred Bloggs

I want to get the opposite and the following doesn't work...why ?

$line =~ s/!(\<.*?\>)//g;

I think that probably just trying to inverse a regex won't work.   I
can't seem to find the print command for regex's.   I'm sure I used to
use /p in sed or vi to print out a matched pattern but I can't find a
similar command in perl.

Thanks for any help
Doug.
If emailing please use : doug@3dlabs.com



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

Date: Tue, 03 Feb 1998 12:33:10 +0100
From: Peter Wahl <wahl@lts.sel.alcatel.de>
Subject: Re: Inverse of a regex
Message-Id: <34D70076.4460@lts.sel.alcatel.de>

Doug wrote:
> 
> Hi,
>    I want to strip out the bracketed part of an email address (or html
> tags come to think of it).   The line I have is
> 
> $line = "From: Fred Bloggs <fred.bloggs@network.com>"
> 
> and if I use
> 
> $line =~ s/(\<.*?\>)//g;
> 
> I get the result
> 
> From: Fred Bloggs
> 
> I want to get the opposite and the following doesn't work...why ?


I would propose 
$line =~ s/.*(\<.*\>).*/$1/g;

or the two step solution

$line =~ s/.*\</</g;
$line =~ s/\>.*/>/g;

or the two step solution

$line =~ s/^[^<]*//g;
$line =~ s/[^>]*$//g;
-- 

Regards - Peter


-------------------------------------------------------------------
Peter Wahl        network management department    Alcatel Telecom
                  EMail: wahl@lts.sel.alcatel.de   Lorenzstrasse 10
Dept. US/EE3      Phone: +49-711-821-43431         70435 Stuttgart
Room: 60/1/L29    Fax:   +49-711-821-42303         Germany
-------------------------------------------------------------------


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

Date: 3 Feb 1998 13:06:43 GMT
From: peter.edlund@capgemini.se
Subject: Re: Inverse of a regex
Message-Id: <6b74p3$2m7$1@news.capgemini.se>

>[Snip]
>I want to strip out the bracketed part of an email address (or html
>tags come to think of it).   The line I have is
>
>$line = "From: Fred Bloggs <fred.bloggs@network.com>"
>
>and if I use
>
>$line =~ s/(\<.*?\>)//g;
>[Snip]

Well, what you are actually doing here is using the PATTERN-REPLACEMENT function -
i.e you're searching for <fred.bloggs@network.com> and replacing it with nothing.

There's many ways to achieve this (this is perl after all..) but here's one way:

($line) = ($line =~ /(\<.*?\>)/);

This will put out <fred.bloggs@network.com>

Hope it helps,
//peter.
-- 
-------------------------
Peter Edlund
UNIX development engineer
Cap Gemini
peter.edlund@capgemini.se


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

Date: Tue, 03 Feb 1998 09:04:28 +0000
From: Glenn West <westxga@ptsc.slg.eds.com>
Subject: Re: Inverse of a regex
Message-Id: <34D6DD9C.764@ptsc.slg.eds.com>

Doug wrote:
> 
> Hi,
>    I want to strip out the bracketed part of an email address (or html
> tags come to think of it).   The line I have is
> 
> $line = "From: Fred Bloggs <fred.bloggs@network.com>"
> 
> and if I use
> 
> $line =~ s/(\<.*?\>)//g;
> 
> I get the result
> 
> From: Fred Bloggs
> 
> I want to get the opposite and the following doesn't work...why ?
> 
> $line =~ s/!(\<.*?\>)//g;
> 
> I think that probably just trying to inverse a regex won't work.   I
> can't seem to find the print command for regex's.   I'm sure I used to
> use /p in sed or vi to print out a matched pattern but I can't find a
> similar command in perl.
> 
> Thanks for any help
> Doug.

How about:

$line =~ s/.*(<.*>).*/$1/;


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

Date: Tue, 03 Feb 1998 08:25:24 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: simonson@skopen.dseg.ti.com
Subject: Re: Is There a Way to Switch the case Sensitivity of Pattern Recognition?
Message-Id: <34D728D4.20FC789F@houston.Geco-Prakla.slb.com>

Kevin M Simonson wrote:
<snip>
>                #!/usr/local/bin/perl
>                $Jqz = "Mno";
>                if ($Jqz =~ /Mno/)
>                {  print "Control succeeded.\n";
>                }
>                else
>                {  print "Control failed.\n";
>                }
>                if ($Jqz =~ /mno/)
Use the i operator for m//,s// to make case insensitive.

	if ($Jqz =~ /mno/i)
>                {  print "Test succeeded.\n";
>                }
>                else
>                {  print "Test failed.\n";
>                }
>                h48^h/simonson/Thanos} CaseSen
>                Control succeeded.
>                Test failed.
>                h48^h/simonson/Thanos}
> 
>      Sorry if this is in the FAQ, but I'm not sure how to go about getting
> ahold of the FAQ.
It's part of the perl std. distribution.  man perl, man perldoc, perldoc
perl, perldoc perldoc, perldoc perlfaq

Any and/or all of the above should be of some assistance.

HTH.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: Tue, 03 Feb 1998 14:20:03 +0000
From: Pablo Hortal <mcai3ph2@ist4.co.umist.ac.uk>
Subject: LOW LEVEL PERL HELP
Message-Id: <34D72792.FD1E35AA@ist4.co.umist.ac.uk>

Hi there,

I have to write a simple Perl script to communicate
with a Printed Circuit Board, through a simple serial
link (RS232 link).

I have been advised to use ioctls.
Has anyone have a bit of info. about this ioctls stuff?


Thank you very much,
Pablo Hortal.




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

Date: Tue, 03 Feb 1998 14:21:17 +0000
From: Pablo Hortal <mcai3ph2@ist4.co.umist.ac.uk>
Subject: LOW LEVEL PERL HELP
Message-Id: <34D727DC.6C1E7D91@ist4.co.umist.ac.uk>

Hi there,

I have to write a simple Perl script to communicate
with a Printed Circuit Board, through a simple serial
link (RS232 link).

I have been advised to use ioctls.
Has anyone have a bit of info. about this ioctls stuff?


Thank you very much,
Pablo Hortal.




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

Date: Tue, 03 Feb 1998 14:22:20 +0000
From: Pablo Hortal <mcai3ph2@ist4.co.umist.ac.uk>
Subject: LOW LEVEL PERL HELP
Message-Id: <34D7281C.741F7AB3@ist4.co.umist.ac.uk>

Hi there,

I have to write a simple Perl script to communicate
with a Printed Circuit Board, through a simple serial
link (RS232 link).

I have been advised to use ioctls.
Has anyone have a bit of info. about this ioctls stuff?


Thank you very much,
Pablo Hortal.




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

Date: Tue, 03 Feb 1998 14:23:55 +0000
From: Pablo Hortal <mcai3ph2@ist4.co.umist.ac.uk>
Subject: LOW LEVEL PERL HELP
Message-Id: <34D7287B.4674E449@ist4.co.umist.ac.uk>

Hi there,

I have to write a simple Perl script to communicate
with a Printed Circuit Board, through a simple serial
link (RS232 link).

I have been advised to use ioctls.
Has anyone have a bit of info. about this ioctls stuff?


Thank you very much,
Pablo Hortal.




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

Date: Tue, 03 Feb 1998 14:25:07 +0000
From: Pablo Hortal <mcai3ph2@ist4.co.umist.ac.uk>
Subject: LOW LEVEL PERL HELP
Message-Id: <34D728C3.7E7B35F8@ist4.co.umist.ac.uk>

Hi there,

I have to write a simple Perl script to communicate
with a Printed Circuit Board, through a simple serial
link (RS232 link).

I have been advised to use ioctls.
Has anyone have a bit of info. about this ioctls stuff?


Thank you very much,
Pablo Hortal.




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

Date: 3 Feb 1998 12:59:39 GMT
From: David E Newman <denewman@cs.buffalo.edu>
Subject: Math Floor and Ceiling Function
Message-Id: <6b74br$c2q$1@prometheus.acsu.buffalo.edu>

I was wondering if there was a Perl supports the 
math function floor and ceiling. I can write my
own functions but if Perl already supports them
I'd like to use them.

Thanks in advance.


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

Date: Tue, 03 Feb 1998 08:29:25 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Math Floor and Ceiling Function
Message-Id: <pudge-0302980829250001@ppp-5.ts-1.kin.idt.net>

In article <6b74br$c2q$1@prometheus.acsu.buffalo.edu>, David E Newman
<denewman@cs.buffalo.edu> wrote:

# I was wondering if there was a Perl supports the 
# math function floor and ceiling. I can write my
# own functions but if Perl already supports them
# I'd like to use them.

Both are supported in the POSIX module.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==       New Book: MacPerl:  Programming for the Rest of Us       ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: 03 Feb 1998 14:41:00 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
To: denewman@cs.buffalo.edu
Subject: Re: Math Floor and Ceiling Function
Message-Id: <7x1zxkolg3.fsf@beavis.vcpc.univie.ac.at>

Re: Math Floor and Ceiling Function, David
<denewman@cs.buffalo.edu> said:

David> I was wondering if there was a Perl supports the math
David> function floor and ceiling. I can write my own
David> functions but if Perl already supports them I'd like
David> to use them.

floor and ceil are both in the POSIX module.

hth,
tony


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

Date: 3 Feb 1998 09:42:36 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Math Floor and Ceiling Function
Message-Id: <6b7acs$l2v@panix.com>

In <6b74br$c2q$1@prometheus.acsu.buffalo.edu> David E Newman <denewman@cs.buffalo.edu> writes:

>I was wondering if there was a Perl supports the 
>math function floor and ceiling. I can write my
>own functions but if Perl already supports them
>I'd like to use them.

It must be my lucky day -- I just pointed someone else to perlfaq4 (Data
Manipulation):

  Does perl have a round function? What about ceil() and floor()? Trig 
  functions? 

  For rounding to a certain number of digits, sprintf or printf is usually 
  the easiest route. 

  The POSIX module (part of the standard perl distribution) implements ceil, 
  floor, and a number of other mathematical and trigonometric functions. 

[ snip ]

The rest is found at: http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfaq4/Does_perl_have_a_round_function_.html

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: 3 Feb 1998 13:52:52 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Module design question (use Exporter vs require Exporter)
Message-Id: <6b77fk$mmr@news.service.uci.edu>

In article <6b5sil$ng7$1@twain.mvp.net>,
Michael King <NOSPAM_mike808@mvp.net> wrote:

<What is (if any) the difference (besides the documented compile-time vs.
<run-time semantic differences) between the two usages?

Well, perldoc -f use says

Imports some semantics into the current package from the named module,
generally by aliasing certain subroutine or variable names into your
package.  It is exactly equivalent to

    BEGIN { require Module; import Module LIST; }     

<Why would I want to use one form instead of the other for a module I am
<authoring?

When I write a module, I rely on h2xs to produce a stub that I can complete.

63  5:51    h2xs -XAfn Foobar
64  5:51    cd Foobar/
65  5:51    more Foobar.pm   

And it spits out require.

HTH,
Eric
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Tue, 3 Feb 1998 10:54:58 +0100
From: "Laurens van Alphen" <alphen@craxx.com>
Subject: Re: Multi-line blocks of text
Message-Id: <6b6phk$emn$1@dinkel.civ.utwente.nl>

well.. i think i've finished to job somewhat.. this seems to work pretty
well

it reads from stdin only and the first command line argument is the user
that should be looked for. i'm just wondering if the input record seperator
can be made case insensitive... never mind if it needs alot of coding...

--- begin ---
#!/usr/bin/perl -w
# copyright (c) 1998, craxx
# all rights reserved
# many thanks to tad mcclellan <tadmc@flash.net>

# get the program name
$name = $0;
$name =~ s|.*/(.*)|$1|;

if ( $#ARGV == -1 ) {
  print "usage: $name username < inputfile > outputfile\n";
  exit 0;
}

# print out the comments at the top
while (<STDIN>) {
    print;              # just echo the comments
    last unless /^#/;   # bail from loop at first non-comment line
}

# set the "input record separator"
$/ = "</VirtualHost>\n\n";

# print the record unless we find the record we want to delete
while (<STDIN>) {
    print unless /^\W*User\W*$ARGV[0]\W*$/im;
}
--- end ---

--
laurens van alphen
alphen@craxx.com






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

Date: 3 Feb 1998 11:07:00 GMT
From: Jim Spath <jspath@mail.bcpl.lib.md.us>
Subject: New core dump on long-working troff2html
Message-Id: <6b6tok$5jn$1@news.abs.net>
Keywords: perl troff html

I've been using a troff to html converter for a couple years and it has
started dumping core on fairly benign input. The perl code has been at:
http://www.cmpharm.ucsf.edu/~troyer/troff2html/ since October 1994.

A 400-line troff file core dumps under the current perl (5.004) on two
systems I've tried but doesn't under 5.003.  Can someone give me some
tips as to how to debug this other than simply "-w"?

Thanks!
-- 
//jes DSN="Webmaster Jim"


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

Date: Tue, 03 Feb 1998 21:59:38 +0800
From: Ng Kwang Loong <stanleyng@cheerful.com>
Subject: Outlook and perl
Message-Id: <34D722CA.88C394E0@cheerful.com>

I know this is more like a OLE problem than a perl question.
I am working on a project and i need to make a perl script interact with
outlook 97 or schedule+, this it to open the two programs schedules and
reformat into html.
if u didn't explain myself clearly, please emial to me for more info

--
 ..ooOOOoo..oo000oo..ooOOOoo..oo000oo..ooOOOoo..ooOOOoo..

                    Ng kw`ng lVVng St`nliy
                    ngloong@post1.com :^

 ..ooOOOoo..oo000oo..ooOOOoo..oo000oo..ooOOOoo..ooOOOoo..




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

Date: 3 Feb 1998 09:07:26 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Passing URL to Browser from Script
Message-Id: <6b78au$ibt@panix.com>

In <34D5F140.7CAE042C@axe.humboldt.edu> Scott Kelley <jsk2@axe.humboldt.edu> writes:

>This is a cryptographically signed message in MIME format.

>--------------msDFB546772F4DBF93B78B351F
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit

>I'm trying to write a CGI script that will pass a URL to the user's
>browser rather than the script printing the file line by line.  Any
>thoughts?

Yes. You post MIME crap in the newsgroup with a question that may or may
not be about Perl.

What's this? More MIME crap?

>--------------msDFB546772F4DBF93B78B351F
>Content-Type: application/x-pkcs7-signature; name="smime.p7s"
>Content-Transfer-Encoding: base64
>Content-Disposition: attachment; filename="smime.p7s"
>Content-Description: S/MIME Cryptographic Signature

>MIIG3wYJKoZIhvcNAQcCoIIG0DCCBswCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHAaCC
>BRgwggJ2MIIB36ADAgECAgENMA0GCSqGSIb3DQEBBAUAMHExCzAJBgNVBAYTAlVTMSIwIAYD

[ MIME crap snipped ]

1. Please reconfigure your newsreader to get rid of the MIME crap.

2. Ask CGI questions in a CGI newsgroup.

3. Ask Perl questions in this newsgroup only if you've done some work.

   a. Asking a question like: 

      "I want a program to do X. What do you think?"

      isn't going to get you anything but grief.

   b. Asking a question like:

      "How do I round a number to two decimal places?"

      is also going to give you grief, because you didn't look at
      the FAQ yet.

   c. Asking a question like:

      "How old is the Perl language?"

      is also going to give you grief, because the question and several
      followup answers were asked yesterday. Read the newsgroup and use 
      a tool like DejaNews to search the newsgroup for a topic *before*
      you post a question.

   d. If you ask a question, always try to post the relevant code. Most
      readers of the newsgroup acknowledge that they are not mindreaders.
      A chunk of code is worth a thousand words...

   e. In all cases, don't expect an answer. If someone has something to 
      say they'll say it. Otherwise your question might be so far out in
      left field that no one has a comment.

When you get to this point, you'll find the newsgroup a much friendlier
place. :)

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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