[10059] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3652 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 7 12:07:12 1998

Date: Mon, 7 Sep 98 09:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 7 Sep 1998     Volume: 8 Number: 3652

Today's topics:
    Re: Beginner's question (I.J. Garlick)
        Bold print <kamrani@ifi.uio.no>
    Re: Bold print <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: comp.lang.perl.announce redux (Jacqui Caren) (Jacqui Caren)
        DB::File and fdopen?? <nwp@galleryonline.com>
        Financial Function Needed <superbock@publicis.pt>
        Financial Function needed <superbock@publicis.pt>
    Re: fork problem: two children finishes at the same tim dwiesel@my-dejanews.com
        Help with a bug in a soft <plateforme@wanadoo.fr>
        help with regexp <weav@hursley.ibm.com>
        How to handle dead DBPROCESS in Sybperl (ct_sql) hugill_david@jpmorgan.com
    Re: IO::File Permissions - Revisited (Ronald J Kimball)
    Re: IO::File Permissions - Revisited <sneaker@sneex.fccj.org>
        LWP:: How to get only <TITLE> from the HEAD? <sochorov@vse.cz>
        make depend loops forever <tuc@ttsg.com>
        mkdir & anonymous allowed in perl sadell@my-dejanews.com
        mkdir & anonymous don't work <sadell@cs.lubasa.es>
    Re: Novell - Perl 5 Help <b0th@geocities.com>
        Perl equivalents of csh commands <lina@kbss.bt.co.uk>
    Re: Perl equivalents of csh commands <J.D.Gilbey@qmw.ac.uk>
        Problems with UNC on Windows platforms <felber@cybernetic.ch>
    Re: Question regarding perl-script as suid <beirne@neo.lrun.com>
    Re: Text::CSV parsing sporadically (David A. Black)
        user environment variable mbower@my-dejanews.com
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 7 Sep 1998 08:46:21 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: Beginner's question
Message-Id: <EywoD9.H9u@csc.liv.ac.uk>

In article <1deugux.1x3ptaz1afryyuN@slip-32-100-246-42.ny.us.ibm.net>,
kpreid@ibm.net (Kevin Reid) writes:
> Kamran <kamrani@ifi.uio.no> wrote:
> 
>> Hi
>> 
>> How do I tell perl to extract text between to pattern encounter ?
>> For instance I want to print out whatever is of text between
>> the first and the second encounter of the word "public" in
>> the following example
>> 
>> -----------
>> 
>> public abstract void translate(int x,int y)
>> 
>>           Translates the origin of the graphics context to the point
>>           (x, y) in the current coordinate system. Modifies this
>>           graphics context so that its new origin corresponds to the
>>           point (x, y) in this graphics context's original coordinate
>>           system. All coordinates used in subsequent renderingoperations
>>           on this graphics context will be relative to this new origin.
>>           
>> 
>> public abstract color getColor()
>> ...
>> ...
>> ..
>> 
>> -------------
> 
> Other people have suggested regular expressions for extracting chunks of
> a single scalar; here's a solution that'll work for reading from a file:
> 
> $/ = 'public ';

unfortunately this doesn't quite make the grade, sorry.

> 
> After that, each <FILE> will return something like the string q{abstract
> void translate(int x,int y)
> 
>           Translates the origin of the graphics context to the point
>           (x, y) in the current coordinate system. Modifies this
>           graphics context so that its new origin corresponds to the
>           point (x, y) in this graphics context's original coordinate
>           system. All coordinates used in subsequent renderingoperations
>           on this graphics context will be relative to this new origin.
>           
> 
> }.

Didn't on my machine. You got a special version of perl that works
diff everyone eleses?

What about the word 'public' appearing in the body of the text your answer
would find that. Although according to what was asked in strict English, I 
suspect the original poster only wants it too match at the beginning of a
line.

Also I have never been able to make '$/' strip the
character/phrase/word/pattern from what was then read in without doing
something like:-

	s/$pattern//;

Having said all of that there is only 2 slight modifications needed to make
what you where trying to say work:-

$/ = "\npublic ";

while (<FH>) {

   s/public //;
   print "$_\n";
}

Sorry to correct you on this but if you are going to answer someone
(especially some one who announces they are a newbie) you should at least
give an answer that works.

-- 
--
Ian J. Garlick
ijg@csc.liv.ac.uk
postmaster@merseymail.com

Mathematicians are like Frenchmen: whatever you say to them they
translate into their own language, and forthwith it is something
entirely different.
                -- Johann Wolfgang von Goethe


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

Date: Mon, 07 Sep 1998 14:32:56 +0200
From: Kamran <kamrani@ifi.uio.no>
Subject: Bold print
Message-Id: <35F3D278.2A93@ifi.uio.no>

Hi

Is it possible  in perl to format the print out so it
would appear in lets say bold prints ? Example:

-------------------------------------------
public static void println(String message)

< Function Description >

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

I want the first line to be in bold and the rest (funct.desc.) in 
normal fonts.

Thanks

Kamran


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

Date: 07 Sep 1998 17:03:37 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Bold print
Message-Id: <7xvhn0ezhy.fsf@vcpc.univie.ac.at>

Re: Bold print, Kamran <kamrani@ifi.uio.no> said:

Kamran> Hi Is it possible in perl to format the print out so
Kamran> it would appear in lets say bold prints ? Example:

perldoc Term::ANSIColor


-- 
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: Mon, 7 Sep 1998 15:27:05 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: comp.lang.perl.announce redux
Message-Id: <Eyx6x6.J74@ig.co.uk>

In article <35CF01B7.CF6CC0DE@nospam.com>,
Grant Griffin  <grant.griffin@nospam.com> wrote:
>
>
>Tom Christiansen wrote:
>
>> Smiley aside, *please* stop this stupid statement.  It's not true, and
>> you're confused.  Americans and Briton both speak English.  If you'd
>> like to find a different language, go to China or Peru.  Or Wales. :-)
>>
>> --tom
>
>Do you think it is too late to send back my "Webster's New World
>Dictionary of the AMERICAN LANGUAGE" which I have had for twenty years?
>;-)

FWUI, s/AMERICAN/spanish/i; # :->

Jacqui

-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

Date: Mon, 07 Sep 1998 14:23:07 +0100
From: Nick Phillips <nwp@galleryonline.com>
Subject: DB::File and fdopen??
Message-Id: <35F3DE3B.8E5376EB@galleryonline.com>

(perl 5.004 under linux 2.0.35 with db (1.85? - the one that installed
with slackwar 3.3))

I have a subroutine which is trying to lock a file which is being
accessed through DB_File.  I lifted the example code from the Camel Book
(2nd edn., p.393) -- which also appears in the perltie man page, it
seems. There are a couple of problems. First, the untie gotcha, which I
worked out. Second, the subroutine works fine first time through, but
when called for the second time, the "open(DB_FH, "+<&=$fd")" fails with
the system error "Bad file number".

However, if I comment out the locking code, everything seems to work
fine. So the tie seems to have worked, and the values in the database do
get changed. Which seems to imply that $db_obj->fd does not always
return a valid descriptor for use with fdopen.

According to the C dbopen man page, the file descriptor returned is not
related to the actual file being accessed through the libraries, but
will be the same for all processes which call dbopen with the same file
name, and may safely be used for fcntl and flock operations.

In my case, the $fd returned by $db_obj->fd is "3" each time the
subroutine is invoked.

I'm going to try to find a way to lock using just the $fd, without
having to fdopen it first, but...


Suggestions and explanations gratefully received.


Cheers,


Nick
--
nwp@galleryonline.com


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

Date: Mon, 07 Sep 1998 16:16:30 +0000
From: Super Bock <superbock@publicis.pt>
Subject: Financial Function Needed
Message-Id: <35F406DE.72434977@publicis.pt>

I'm Writing a credit Simulation script , and i need a fuction that is
equal to IRR() function of EXCEL.
	Please Help me is URGENT!

email: Pedro.Cordeiro@publicis.pt or absolut_cordeiro@yahoo.com


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

Date: Mon, 07 Sep 1998 16:21:03 +0000
From: Super Bock <superbock@publicis.pt>
Subject: Financial Function needed
Message-Id: <35F407EF.FF0D0AB1@publicis.pt>

I'm writing a credit simulation and i need a fuction that is equal to
the IRR() EXCEL function .
Please is URGENT! 
I'm working in IRIX.


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

Date: Mon, 07 Sep 1998 13:16:36 GMT
From: dwiesel@my-dejanews.com
Subject: Re: fork problem: two children finishes at the same time!
Message-Id: <6t0mbl$p4u$1@nnrp1.dejanews.com>

Hi again. I didn4t get any answer to this question... does that mean that
nobody knows??? I would really appriciate every answer... // Daniel

By the way: Yes! I have set $| = 1; and flush(STDOUT); before calling exit; in
every child.

In article <6su4rr$kph$1@nnrp1.dejanews.com>,
  dwiesel@my-dejanews.com wrote:
> Hi,
>
> I've got a perl program where I do a lot of forking. Each fork prints a string
> to STDOUT and each fork takes some seconds to complete.
>
> My problem is that sometimes two children finishes at the same time and then
> one or both of the children doesn't print to STDOUT. I wan't to be sure that
> two children don't finish at the same time. I can't 'sleep' for a random
> number seconds because they can finish at the same time anyway.
>
> Is there a solution to this problem?
>
> // Daniel
>
> I've been to the site http://www.positionagent.com. It seems as they also do a
> lot of forking. My program is very similar to their program - but I've never
> seen their program fail... Therefore I assume that there is a solution...
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 07 Sep 1998 16:40:30 +0200
From: Plate Forme Jeunes Diplomes <plateforme@wanadoo.fr>
Subject: Help with a bug in a soft
Message-Id: <35F3F05D.BDEB62B9@wanadoo.fr>

    Hello,

    I would like extracting data in a file, before print it. I can't
with this programm. Why? I don't understand.

    Thanks for your help.

open (FILE,"Dr129a.htm");

$offre=$1 if /\b (Offre\b.*\bX)/;
$date=$2 if /\b (Date\b.*\b98)/;
$Ale=$3 if /\b (Ale\b.*\bTD)/;
$duree=$4 if /\b (Recherche\b.*\bFONT)/;
$descriptif=$5 if /\b (CENTER\b.*\bFONT)/;
$lieu=$6 if /\b (Lieu\b.*\bFONT)/;
$horaires=$7 if /\b (Horaires\b.*\bFONT)/;
close (FILE);
print $offre ;
print $date ;
print $Ale ;
print $duree ;
print $descriptif;
print $lieu ;
print $horaires



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

Date: Mon, 07 Sep 1998 15:54:04 +0100
From: Nick Weavers <weav@hursley.ibm.com>
Subject: help with regexp
Message-Id: <35F3F38C.8EBA37F1@hursley.ibm.com>

Can anybody help me?

I the string snippet:

library ibm; use ibm.synthesis_support.all; library ieee; use
ieee.std_logic_1164.
all; use work.hvt_synth.all; entity eiarb is  end eiarb; architecture c6sf of
eiar
b is function "="(x : std_logic_vector;y : std_logic_vector ) return boolean is
be
gin return std_match (x ,y ); end "="; begin new_requests_inp<= licreq & micreq
& 
picreq; new_requests_pulse (2 downto 0 ) <= (new_requests_inp (2 downto 0 ) and
no
t new_requests (2 downto 0 )); new_reqs_pulse<=new_requests_pulse; mreqs <=
mreql 

I am looking for this bit:

function "="(x : std_logic_vector;y : std_logic_vector ) return boolean is be
gin return std_match (x ,y ); end "=";

I have tried the following which works: 
00 #!/perl5 
 .. ...
01 ($type,$funcname,$rest) = $file_string =~ /                                 
02      \b           (?# start at a word
boundary)                                
03      (function)   (?# followed by the word
"function")                         
04      \s+          (?# followed by one or more
spaces)                          
05      (\S+)        (?# followed by the function name which must be
remembered)  
06      \s*          (?# followed by none or more
spaces)                         
07     
\(                                                                        
08      (.*?         (?# followed by
anything)                                    
09      \b           (?# followed by a word
boundary)                             
10      end          (?# followed by the word "end" preceded by a space)         
11      \s+          (?# followed by one or more
space)                           
12      \S+          (?# followed by the function
name)                           
13      \s*          (?# followed by one or more
space)                           
14      \;)          (?# followed by a
semicolon)                                 
15 /sx;                                                                        
16                                                                                
17                                                                                
18 print $file_string;                                                         
19 print "\n\n";                                                               
20 print "$type = $funcname\n";                                                
                                                                                
Which results in:

function = "="
rest = x : std_logic_vector;y : std_logic_vector ) return boolean is begin
return 
std_match (x ,y ); end "=";

But the pattern isn't as strict as I would like since line 12 should really use
the
value that was captured by line 05. However, when I try:  

00 #!/perl5 
 .. ...
01 ($type,$funcname,$rest) = $file_string =~ /                                 
02      \b           (?# start at a word
boundary)                                
03      (function)   (?# followed by the word
"function")                         
04      \s+          (?# followed by one or more
spaces)                          
05      (\S+)        (?# followed by the function name which must be
remembered)  
06      \s*          (?# followed by none or more
spaces)                         
07     
\(                                                                        
08      (.*?         (?# followed by
anything)                                    
09      \b           (?# followed by a word
boundary)                             
10      end          (?# followed by the word "end" preceded by a space)         
11      \s+          (?# followed by one or more
space)                           
12      \1           (?# followed by the function
name)                           
13      \s*          (?# followed by one or more
space)                           
14      \;)          (?# followed by a
semicolon)                                 
15 /sx;                                                                        
16                                                                                
17                                                                                
18 print $file_string;                                                         
19 print "\n\n";                                                               
20 print "$type = $funcname\n";
 
Gives:

 = 
rest = 

I tried using $1 rather than \1 but to no avail. Can anyone tell my why \1 does 
not work in this expression?

Thanks,
Nick Weavers.


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

Date: Mon, 07 Sep 1998 14:23:21 GMT
From: hugill_david@jpmorgan.com
Subject: How to handle dead DBPROCESS in Sybperl (ct_sql)
Message-Id: <6t0q8p$tk9$1@nnrp1.dejanews.com>

I have a program which uses the CTlib procedure ct_sql() to return the result
set. One of the servers it is running against has an odd problem which causes
Perl to hang on the ct_sql() call.

When you use isql, if you try anything that uses tempdb (e.g. sp_who), the
messages:
The SQL server is terminating this process.
DBPROCESS is dead or not enabled.

Is there something missing inside ct_sql() which should be detecting the error
and returning failure?

I'm invoking it as follows:
foreach $row ($con->ct_sql($sql)) {
    # process a returned row
}

The server problem will get fixed (soon I hope). What I want to do is protect
against future problems, since the program is an important tool in tracking
schema differences across our 20+ servers. At the moment it is inoperable.

- David

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 7 Sep 1998 11:33:31 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: IO::File Permissions - Revisited
Message-Id: <1dezhan.znik81whszozN@bay1-373.quincy.ziplink.net>

Lack Mr G M <gml4410@ggr.co.uk> wrote:
>

That was a good call on why IO::File wasn't working as Sneex expected!

>    Presumably the problem is that the only way to open a file with a
> PERMS option is to use sysopen, and that needs umeric MODEs.  However,
> this seems to be missing from the documentation..... 

It does appear to be documented in my copy of IO::File.pm, although
perhaps it could be more emphatic:

    If IO::File::open receives a Perl mode string (">", "+<", etc.) or a
    POSIX fopen() mode string ("w", "r+", etc.), it uses the basic Perl
    open operator.

    If IO::File::open is given a numeric mode, it passes that mode and
    the optional permissions value to the Perl sysopen operator.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 07 Sep 1998 11:46:04 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: IO::File Permissions - Revisited
Message-Id: <35F3FFBC.F3A32E67@sneex.fccj.org>

Martien Verbruggen wrote:
> 
<Snip>

> There's more information in the man pages for creat(2) and on many
> systems in intro(2).
> 
> > And they all create the file with 0644...
> 
> Hmm. They shouldn't. The umask should just clear the umask bits in
> your creation mode. It should not set bits that aren't set already.
> What's the system you're on?
> 
> Martien

I agree with you, plus I'll try Garry's umask of 077 and
post follow ujp experiments here.

I am on RedHat 5.1, using Perl 5.004_04, but I downloaded
these and will try them in turn:
      3381915 Aug  9 11:11 perl5.004_74.tar.gz
      3470355 Aug  9 11:16 perl5.005_02.tar.gz
      3732403 Aug  9 11:21 perl5.005_50.tar.gz
      3797732 Aug 15 19:51 perl5.005_51.tar.gz

Thanks for the input :]
-Sneex- 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
It is common sense to take a method and try it.  If it fails,
admit it frankly and try another.  But above all, try something.
                -- Franklin D. Roosevelt


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

Date: Mon, 07 Sep 1998 16:32:33 +0100
From: Marta Sochorova <sochorov@vse.cz>
Subject: LWP:: How to get only <TITLE> from the HEAD?
Message-Id: <35F3EE81.D8719AD7@vse.cz>

Hi, 

   I use LWP::UserAgent to GET a http document, but it takes too long.
If I use HEAD, I get some information (server, last modified, ...), but not
<TITLE> and <META.....>.

Can I get <TITLE> without waiting for the whole document?


                        Marta


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

Date: Mon, 07 Sep 1998 10:42:58 -0400
From: Tuc <tuc@ttsg.com>
Subject: make depend loops forever
Message-Id: <35F3F0F2.FC477991@ttsg.com>

Hi,

I'm trying to install 5.004_04 on a BSDI 3.1 system, like I've done
on 6 other BSDI 3.0/3.1 systems.  The first thing I do is go in
and edit the hints/bsdos.sh file and change the 3.1 to 4.0, and the
3.0 to 3. .  Then I ./Configure .  Everything goes fine. On 6
systems I do a "make depend" and it works fine.  On the 7th I 
get :

Script started on Sat Sep  7 01:18:31 1996
test# make depend
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh
Makefile.SH                                                            

forever.  The only difference about this system is that it has
768M instead of 128M like the others.  Other than that, it only has
19 or 20 processes running, and plenty of space left.

I even copied the perl5.004_04 directory from another machine over
and tried it and it looped like that.  Any ideas?

Thanks, Tuc/TTSG
tuc@ttsg.com


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

Date: Mon, 07 Sep 1998 14:34:44 GMT
From: sadell@my-dejanews.com
Subject: mkdir & anonymous allowed in perl
Message-Id: <6t0qu4$ufa$1@nnrp1.dejanews.com>

I'm creating directories with perl like this :
  mkdir direct,0777
and all is correct. But when I change the permisions in the IIS 3.0 adding
"Anonymous allowed", this line doesn't work.
Which is the reason?
Is not possible to create a directory when anonymos are allowed?.
Thanks in advanced.

Sonia Adell

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 07 Sep 1998 17:04:01 +0200
From: Sonia Adell <sadell@cs.lubasa.es>
Subject: mkdir & anonymous don't work
Message-Id: <35F3F5E1.90102930@cs.lubasa.es>

I can't do a 

	mkdir dirname,0777

instruction when I change the permisions in the IIS 3.0 adding
"Anonymous allowed".
Before these change, all worked perfectly.
Which is the reason?

Thanks in advanced.

Please send me your help to my e-mail. I can't read news frecuently.
Sorry by my English.

Sonia Adell
mailto:sadell@cs.lubasa.es


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

Date: Mon, 7 Sep 1998 15:41:25 +0100
From: "Andrew Robinson" <b0th@geocities.com>
Subject: Re: Novell - Perl 5 Help
Message-Id: <6t0rap$4u8$1@probity.mcc.ac.uk>

Here is the script as requested, thanks a lot for your quick reply.
I realise the smtp.pl may not work however I can not get the script to even
return an error when the E-mail address is incorrect.

#!c:/perl5/bin/perl.exe

require ("cgi-lib.pl");
#require 'smtp.pl';

use Text::Wrap;

#
# Parse the info sent from the client
&ReadParse;
#
# Now store all the relevant fields in local variables.
$first = $in{'first'};
$last = $in{'last'};
$title = $in{'title'};
$department = $in{'department'};
$phone = $in{'phone'};
$first = $in{'first'};
$email = $in{'email'};
$job = $in{'job'};
$interests = wrap("","",$in{'interests'});
$skills = wrap("","",$in{'skills'});
$equipment = wrap("","",$in{'equipment'});
$colleagues = wrap("","",$in{'colleagues'});
$inter = $in{'inter'};
$intertext = wrap("","",$in{'intertext'});
$grant = $in{'grant'};
$man = wrap("","",$in{'man'});
$fund = wrap("","",$in{'fund'});
$bodies = wrap("","",$in{'bodies'});
$industry = wrap("","",$in{'industry'});
$web = $in{'web'};
$urls = wrap("","",$in{'urls'});


if ($email !~ /.+@.+/){
    print &PrintHeader, &HtmlTop("Error in e-mail address");
    print "<H1>Error in form data</h1>\n";
    print "Sorry, but the electronic mail address you supplied
\'<b>$email</b>\'";
    print " does not look right to me.<p>\n";
    print "Please try again.<p>\n";
    print &HtmlBot;
    exit;
}
#
# Here we format the mail message and send it off:
#
$msgfile = sprintf "MF%6lx.txt",time;
open(MSG,">$msgfile");
print MSG <<EOMSG;
Name:       $first
    :       $last

Title:      $title
Department: $department
Job Title:  $job

E-mail:     $email

Phone:      $phone

Research Interests:
$interests

Research Skills:
$skills

Research Equipment:
$equipment

International Colleagues:
$colleagues

Interdisciplinary/Multidisciplinary Research:
$inter

$intertext

European or non-UK research grant ?:
$grant

Manchester based research group:
$man

Funding Councils:
$fund

Professional Bodies:
$bodies

Industrial Contacts:
$industry

Web Page:
$web

$urls
EOMSG
close MSG;

sendmail($email,'fiona.l.brown@man.ac.uk','',"$first",
         $msgfile);


# Output the HTML header garbage
print &PrintHeader, &HtmlTop("Research Register");

print <<EOT;
<hr><table>
<tr><td valign=top>Name:<td valign=top>$first
<tr><td valign=top><td valign=top>$last
<tr><td valign=top>E-mail:<td valign=top>$email
<tr><td valign=top>Phone number:<td valign=top>$phone
<tr><td valign=top>Title:<td valign=top>$title
<tr><td valign=top>Department:<td valign=top>$department
<tr><td valign=top>Job Title:<td valign=top>$job
<tr><td valign=top>Research Interests:
<tr><td valign=top><pre>$interests</pre>
<tr><td valign=top>Research Skills:
<tr><td valign=top><pre>$skills</pre>
<tr><td valign=top>Research Equipment:
<tr><td valign=top><pre>$equipment</pre>
<tr><td valign=top>International Colleagues:
<tr><td valign=top><pre>$colleagues</pre>
<tr><td valign=top>Interdisciplinary/Multidisciplinary Research:<td
valign=top>$inter
<tr><td valign=top><pre>$intertext</pre>
<tr><td valign=top>European or non-UK research grant ?:<td valign=top>$grant
<tr><td valign=top>Manchester based research group:
<tr><td valign=top><pre>$man</pre>
<tr><td valign=top>Funding Councils:
<tr><td valign=top><pre>$fund</pre>
<tr><td valign=top>Professional Bodies:
<tr><td valign=top><pre>$bodies</pre>
<tr><td valign=top>Industrial Contacts:
<tr><td valign=top><pre>$industry</pre>
<tr><td valign=top>Web Page:<td valign=top>$web
<tr><td valign=top><pre>$urls </pre>
</table>
<hr>
Thank you for taking the time to fill in the form, have a nice day !<hr>
EOT
# Finally print out the trailer
print &HtmlBot;

Andrew Robinson
b0th@geocities.com




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

Date: Mon, 07 Sep 1998 14:40:04 +0100
From: lina <lina@kbss.bt.co.uk>
Subject: Perl equivalents of csh commands
Message-Id: <35F3E234.41C67EA6@kbss.bt.co.uk>

I'm trying to find the equivalents of the foll. csh commands in Perl 5:

$cwd - variable which returns the current working directory
$file:h - which returns the root/path of $file
$file:t - which returns the name of the current program ($0 seems to
working for this one)

Also does anyone have any idea how to remove the pattern _^H or _\b
(underscore followed by backspace) from a string as generated in nroff
documents? I tried tr/_^H//d but this gets rid of all straight lines and
tr/_\\b//g doesn't do the job.

Thanks,
Lina.


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

Date: Mon, 07 Sep 1998 15:24:53 +0100
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: Perl equivalents of csh commands
Message-Id: <35F3ECB5.8E4F6@qmw.ac.uk>

lina wrote:
> 
> I'm trying to find the equivalents of the foll. csh commands in Perl 5:
> 
> $cwd - variable which returns the current working directory

use Cwd;
$dir = cwd();

There are also commands getcwd() and fastcwd() in this package.
See the documentation for this package (man Cwd) for more details.

> $file:h - which returns the root/path of $file

$file =~ s@/[^/]*$@@;

leaves $file being the path of $file.  To do this non-destructively,
copy $file into some temporary variable or do this locally to a
block.

> $file:t - which returns the name of the current program ($0 seems to
> working for this one)

Correct.

> Also does anyone have any idea how to remove the pattern _^H or _\b
> (underscore followed by backspace) from a string as generated in nroff
> documents? I tried tr/_^H//d but this gets rid of all straight lines and
> tr/_\\b//g doesn't do the job.

s/_\x08//g;

HTH,

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

       Julian Gilbey                     Email: J.D.Gilbey@qmw.ac.uk
       Dept of Mathematical Sciences,
       Queen Mary & Westfield College,
       Mile End Road, London E1 4NS, ENGLAND


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

Date: Mon, 7 Sep 1998 16:01:26 +0200
From: "Claudio Felber" <felber@cybernetic.ch>
Subject: Problems with UNC on Windows platforms
Message-Id: <6t0p0a$lh7$1@news.imp.ch>

Hi!

I need to create directories and access files over UNC paths on
Windows systems. Opening and working with files is no problem,
but path manipulations such as creating or changing directories
is. Probably because the Perl functions are based on the functionality
of the basic change/make directory of Windows consoles which also
do not work with UNC. So, what am I going to do? I would like to
do something like that:

    chdir '//PDC-Intranet/Backup'             or
    chdir "\\\\PDC-Intranet\\Backup'          or
    mkdir '//PDC-Intranet/Backup/Linux'

    etc...

Any ideas?
-Claudio





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

Date: Mon, 07 Sep 1998 07:57:08 -0400
From: Beirne Konarski <beirne@neo.lrun.com>
Subject: Re: Question regarding perl-script as suid
Message-Id: <35F3CA14.88B72D85@neo.lrun.com>

Ekenberg wrote:
> 
> I'm trying to make a small perl cgi-script to run as its owner (me..).
> 
> The script is chmod 4705 (I also tried 6705)
> I want it to write to a directory that's chmod 700.
> 
> But it doesn't work. Checking the UID:s with $< and $> shows that the script
> is run as nobody, although the suid bit is set.
> 
> There is no external input to the script making it tainted.
> There is no error message from Perl about the UNIX-security hole with
> suid-scripts (which I read about here:
> http://www.w3.org/Security/Faq/wwwsf5.html#Q50 )
> 
> Please tell me what I might be doing wrong!
> Thanks, Johan Ekenberg

You will need to make a C front end to the script that has the setuid
bit set. The perl source distribution contains a convenient script,
wrapsuid, that builds the front end for you if you don't feel like
writing the C.  It doesn't get installed, though, so you'll have to get
it from the source tree.

Beirne

-- 
Beirne "Bern" Konarski  | Unicycling Home Page:
beirne@neo.lrun.com     | http://www.unicycling.org 
"Untouched by Scandal"  | Unicycling Society of America:
                        | http://www.unicycling.org/usa/


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

Date: Mon,  7 Sep 1998 07:51:58 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: Text::CSV parsing sporadically
Message-Id: <6t0hcu$mas$1@earth.superlink.net>

Hello -

steve@inature.com.au (Steve Vertigan) writes:

>Hi.  I'm trying to read data from a CSV file that's been exported from MS 
>Access with the perl module CSV.pm.  The problem is that on a file of about 
>450 records about 360 were parsed ok and 80 were marked as corrupt.  On a 

[snip]

>July-August-September like British summer 150 - 260C. East  access to Gold 

That degree-sign character seems to be the problem.  It doesn't fall within
Text::CSV's range of permitted characters.  (And there may be other chars
causing similar problems - but that's the only one in the sample you gave.)


David Black
dblack@saturn.superlink.net


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

Date: Mon, 07 Sep 1998 15:19:02 GMT
From: mbower@my-dejanews.com
Subject: user environment variable
Message-Id: <6t0th6$20f$1@nnrp1.dejanews.com>

Does anyone know how to get the current username inside a perl script ?

I'm using Apache's httpd and have turned on .htpasswd ,  so it's the username
from here that I want to access.

Please reply to my email (mbower@painewebber.com) if you can help.

Thanks

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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