[11095] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4695 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 20 00:05:43 1999

Date: Tue, 19 Jan 99 21:00:19 -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, 19 Jan 1999     Volume: 8 Number: 4695

Today's topics:
    Re: "Back button" in CGI script (Abigail)
    Re: == and = , again <zenin@bawdycaste.org>
    Re: A question about pack function (Sam Holden)
    Re: about the $| variable! <zenin@bawdycaste.org>
    Re: Can you help me pass data? (Abigail)
    Re: CC via email (Was Re: "Back button" in CGI script) (John Stanley)
        CGI writing to file with ActivePerl on NT with Xitami <patrickt@gmp.usyd.edu.au>
    Re: CGI writing to file with ActivePerl on NT with Xita <patrickt@gmp.usyd.edu.au>
    Re: CGI writing to file with ActivePerl on NT with Xita <collin.starkweather@colorado.edu>
        chat2.pl and Solaris? (Andy Squires)
    Re: chat2.pl and Solaris? <rra@stanford.edu>
    Re: Determining the OS... (Abigail)
    Re: error handling (Tad McClellan)
    Re: flock <zenin@bawdycaste.org>
    Re: How to best process a large CGI form? jlatifi@tsicable.com
    Re: How to get IP address of a local machine under NT <gellyfish@btinternet.com>
    Re: MacPerl question (Andre L.)
    Re: newbie - endless loop on simple program. scott.craig@moh.hnet.bc.ca
        newbie question about tag matching (bei)
        Perl Calendar and Publishing Script... tybee@my-dejanews.com
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 20 Jan 1999 03:58:38 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: "Back button" in CGI script
Message-Id: <783k9e$8n5$1@client2.news.psi.net>

[ Followups set ]

Adrian Price (adrian@sequoiarecords.com) wrote on MCMLXVII September
MCMXCIII in <URL:news:adrian-1901990923360001@webgalaxy.com>:
$$ In article <782bbq$4$1@client2.news.psi.net>, abigail@fnx.com wrote:
$$ 
$$ >Joel M. Borden (mr.marketing@worldnet.att.net) wrote on MCMLXVII
$$ >September MCMXCIII in <URL:news:36A4134D.4BD2@worldnet.att.net>:
$$ >:: Pardon a newbie question...
$$ >:: 
$$ >:: I just got my first script working (a simple mail-generating form)... it
$$ >:: does error-checking, and if required info is missing, I'd like to provde
$$ >:: a "back" link to the HTML page that had the original form, so that the
$$ >:: partial info entered by the user will be retained.
$$ >
$$ >   1) That's not a Perl question.
$$     true. comp.sys.infosystems.www.authoring.cgi would be a better group.
$$ >   2) Every browser already has that functionality.
$$     True, but links are just plain more user-freindly.

Really? Then why doesn't a single browser create a link?

$$ >   3) You can't do that.
$$     Yes you can. If you are going to try to answer a question, answer it
$$ or just keep quiet. If you are going to answer anyway, and still just say
$$ it can't be done, at least note that it can't be done AS FAR AS YOU KNOW.
$$ Five little letters, AFAIK, will do the trick.

Please, read the document mention below, and tell me where it's wrong.
But not in this group, as it has nothing to do with Perl.

$$ >http://www.foad.org/%7Eabigail/HTML/Misc/back_button.html



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: 20 Jan 1999 03:21:07 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: == and = , again
Message-Id: <916802417.200959@thrush.omix.com>

Bart Lateur <bart.lateur@skynet.be> wrote:
: Jim and Paula wrote:
: >I know they hate to expand reserved words, but it would be nice to
: >have  "equals" for  = ,  and "becomes"  for  ==
:
: It would be nicer still, if those were reversed.

	IYHO, but not likely many others.  This has been hashed out many,
	many times.  Most typically by novice programmers (and math types
	who likely shouldn't be coding anyway) wanting the meaning reversed
	from the current usage, and experienced programmers understanding
	(quite correctly) that assignment is oft used 10x more often then
	comparison.

	BTW, switching the two by mistake is an extremely rare (read: almost
	never) event for anyone that runs there compiler/interpreter with
	warnings enabled.  If you don't run `perl -w', `cc -Wall', etc then
	you have no right to complain.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 20 Jan 1999 03:04:10 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: A question about pack function
Message-Id: <slrn7aahta.p5f.sholden@pgrad.cs.usyd.edu.au>

On Wed, 20 Jan 1999 09:26:31 +0800, Mark Nold <markn_nospam_@mincom.com> wrote:
>Hi,
>
>As per the FAQ "How do I convert bits into ints?" im trying to convert a
>binary string to a decimal. Perl only returns a strange character (i assume
>the ascii representation of the binary????). My complete two line script is
>below;
>
>$decimal = pack('B8', '10110110');
>print $decimal, "\n";

You could try ord($decimal);

Of course that won't work with >8 bits...

-- 
Sam

It has been discovered that C++ provides a remarkable facility for
concealing the trival details of a program--such as where its bugs are.
	--David Keppel


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

Date: 20 Jan 1999 03:29:57 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: about the $| variable!
Message-Id: <916802947.503522@thrush.omix.com>

[posted & mailed]

ed98mba <ed98mba@lc.vetlanda.se> wrote:
: due to a desperate attempt to send something to the conferance, me and
: my friends decided to write a nph- program that allows u to play
: card-games with others! however! when we try the simplest script with
: nph- tech. on our small w95 local webserver, it does not work!

	What's the error you get in both the browser and the server logs?

: Can it be that the $| variable don't work on non native systems?

	No.

: this is the code so far!!:
: #! c:\Program\sambar42\perl\perl.exe

	This line does nothing.  Win32 systems have no idea what #! is.
	Check your web server's manual for how to get perl CGIs to run.

: $| = 1;

	Not needed here, but it won't hurt.

: $grans = "_my_strange_line_";
: $text="hi everyone";
: print <<_HUVUD_;
: HTTP/1.1 200 OK

	FYI, this isn't a header, it's a return code.  Your script should
	only be sending headers.  The server will send the return codes.
	This is likely your problem. -Please note this also isn't perl
	related so it should likely be posted to one of the web server
	newsgroups.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 20 Jan 1999 04:11:01 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Can you help me pass data?
Message-Id: <783l0l$8n5$2@client2.news.psi.net>

q2020262@my-dejanews.com (q2020262@my-dejanews.com) wrote on MCMLXVII
September MCMXCIII in <URL:news:782qbi$jdt$1@nnrp1.dejanews.com>:
$$ At the moment I seem to have a slight problem, I've created a program that
$$ creates a frameset using perl, pretty simple, the windows in this frameset ar
$$ created using seperate perl scripts (using a standard <frame src="perl.pl">),
$$ is there anyway to pass data to these frame pages?


Huh? A page is just a page. What's it's supposed to do with data.... ?

Of course, if you want to pass information to the perl programs generating
those pages, the answer is "yes". More details can be found in the
appropriate group.


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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

Date: 20 Jan 1999 04:45:22 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: CC via email (Was Re: "Back button" in CGI script)
Message-Id: <783n12$3tf$1@news.NERO.NET>

In article <MPG.110e535d4cec6e429899a3@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <78270m$282$1@dinkel.civ.utwente.nl>, Willem 
><spam@dikkelul.com> says...
>> 
>> Why not? It could be helpful for others. Besides, is it so hard to do a CC ?
>
>I agree.  Refusal to do so as a matter of policy is a fascistic response 
>to a polite and reasonable request.  I often CC the response on my 
>own, unless requested not to -- it gets to the questioner much faster, as 
>a rule.

Except, of course, when the question being asked has nothing to do with
perl so the answer won't be relevant to perl, either.




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

Date: Wed, 20 Jan 1999 14:39:50 +1100
From: Patrick Taylor <patrickt@gmp.usyd.edu.au>
Subject: CGI writing to file with ActivePerl on NT with Xitami
Message-Id: <36A55005.A8E18E1D@gmp.usyd.edu.au>

Howdy,

currently having buckets 'o fun trying to get a cgi to write to a file
on NT.

All other cgi's are working, and the cgi can read from a file, so I dont
think it's the web server configuration. The code I'm stuck on is (where
name is the cgi parameter passed across) :

open (DATAFILE, >"store.txt") || die "Cannot find data file \n";
flock (DATAFILE, 2);
print DATAFILE <<LISTITEM;
 $in{'name'}
LISITEM
close (DATAFILE) || die "Can't close data file \n";

Do I have to lock the file? Do I have to specify full path names? Why is
everything twice as hard under NT ; )


Ciao




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

Date: Wed, 20 Jan 1999 14:58:39 +1100
From: Patrick Taylor <patrickt@gmp.usyd.edu.au>
Subject: Re: CGI writing to file with ActivePerl on NT with Xitami
Message-Id: <36A5546F.C8C2A39D@gmp.usyd.edu.au>

And before you ask...

> print DATAFILE <<LISTITEM;
>  $in{'name'}
> LISTITEM
>

I fixed the end of input delimeter : (


Ciao



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

Date: Tue, 19 Jan 1999 21:49:21 -0700
From: Collin Starkweather <collin.starkweather@colorado.edu>
To: Patrick Taylor <patrickt@gmp.usyd.edu.au>
Subject: Re: CGI writing to file with ActivePerl on NT with Xitami
Message-Id: <36A56051.3D00@colorado.edu>

While I don't know this from personal experience, I read in an old issue
of the Perl Journal that you have to set the permissions on the web
server SERVICE in NT to get write permissions to work correctly.  

The nature of the permissions and/or ownership I don't know, not being
much of a fan of Windows sysadmin.  My guess, though, is to go to
Start.Control Panel.Services and check out all of the options available
when you click on the service name.

If you are really stuck, go to the library and check the old back issues
of the Perl Journal for Win32 articles describing what the author calls
"gotchas".

Good luck,
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Collin Starkweather                                 (303) 492-4784
University of Colorado            collin.starkweather@colorado.edu
Department of Economics          http://ucsu.colorado.edu/~olsonco
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Patrick Taylor wrote:
> 
> And before you ask...
> 
> > print DATAFILE <<LISTITEM;
> >  $in{'name'}
> > LISTITEM
> >
> 
> I fixed the end of input delimeter : (
> 
> Ciao



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

Date: Wed, 20 Jan 1999 03:37:01 GMT
From: asquires@netcom.com (Andy Squires)
Subject: chat2.pl and Solaris?
Message-Id: <asquiresF5uA1q.ABo@netcom.com>


Hi everyone,

We have a script which uses the chat2.pl module running on Digital Unix,
and we've been trying to port it over to a Solaris (SunOS 5.6) machine.  However, none
of the connections with the chat::open function seem to work.  I feel like
I'm missing something obvious with the set up.  

It will connect on our Digital Unix boxes but not with either of our
Solaris machines.  Any suggestions of things I should check?

I'm using Perl 5.004 04.


TIA.

Andy


-- 
| Andy Squires                  "The trouble with life is
| asquires@netcom.com         there's no background music."
| Web Page is at http://www.capitalrowing.org/andy/



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

Date: 19 Jan 1999 20:45:01 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: chat2.pl and Solaris?
Message-Id: <yl90eyo8mq.fsf@windlord.stanford.edu>

Andy Squires <asquires@netcom.com> writes:

> We have a script which uses the chat2.pl module running on Digital Unix,
> and we've been trying to port it over to a Solaris (SunOS 5.6) machine.
> However, none of the connections with the chat::open function seem to
> work.  I feel like I'm missing something obvious with the set up.

> It will connect on our Digital Unix boxes but not with either of our
> Solaris machines.  Any suggestions of things I should check?

You really want to use the Expect module from CPAN rather than chat2.pl,
which is likely to eventually be removed from the distribution.  It's
pretty broken on a lot of platforms and is *really* old.  Expect and the
IO::* modules it uses are much more modern and much better implemented.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 20 Jan 1999 04:14:17 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Determining the OS...
Message-Id: <783l6p$8n5$3@client2.news.psi.net>

Andrew Fry (andrewf@beausys.demon.co.uk) wrote on MCMLXVII September
MCMXCIII in <URL:news:v6$UbLAlAMp2Ewv0@beausys.demon.co.uk>:
-- Q1:
-- What is the correct (OS-independent) way to determine the
-- OS ... is it $^O ?

What did 'man perlvar' tell you?

-- Q2:
-- Also, I have a Perl script which sets up configuration files
-- for IP-over-X.25 operation. This requires super-user privileges.
-- I am trying to produce a CGI version of this script ... but how,
-- basically, do I become super-user from within the script ?

You don't. You can run the script as a superuser though. But that's
not a Perl question. Besides, if you have to ask how, you shouldn't
be doing that. Too dangerous.



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: Tue, 19 Jan 1999 21:04:09 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: error handling
Message-Id: <93h387.voi.ln@magna.metronet.com>

Vyacheslav Volodchenko (slava@volodchenko.freeserve.co.uk) wrote:

: The following script generates a run time error.
: It says "sh: Bad number".

: #!/usr/local/bin/perl

: $ps_file = "picture.ps"; # postscript file
: `pstogif $ps _file >& /dev/null`;

: I think shell misinterprets redirection and considers it as a part of
: the command.


   The shell interprets redirection just fine.

   It is the Bourne shell however, not the csh, so you should use
   sh syntax for redirection.


: Can anyone suggest me a way to run srcipt in the context of different
: shell or a different way to avoid output from this program being printed on
: the screen.


   Since you are using backticks, this would be a good time to
   look up what the documentation that came with your perl
   distribution (perlop.pod) has to say about backticks:

---------------------
=item qx/STRING/

=item `STRING`

A string which is (possibly) interpolated and then executed as a system
command with C</bin/sh> or its equivalent.  Shell wildcards, pipes,
and redirections will be honored.
---------------------


   A few lines further down in the above mentioned docs show
   how to redirect the standard error output.



   How 'bout that?

   You could have had the answer in less time than it took to
   type up your article...


   Use the docs Luke.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 20 Jan 1999 03:43:00 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: flock
Message-Id: <916803730.178989@thrush.omix.com>

[posted & mailed]

M. Morgan <mmorgan@gladstone.uoregon.edu> wrote:
: Anyone here know about flock?

	Yes.

: For example:
: open(LOG, ">>logfile.txt") || die "an error occured";
: flock(LOG,2);

	#1, you don't test the return value of your flock() so you don't
	know if it fails.  #2, use Fcntl ':flock' to get the flock()
	constants.  Don't use raw values if you can avoid it as they
	aren't guaranteed to be the same on all systems.

: print LOG $comments;
: flock(LOG,8);

	#3, Never, ever unlock a lock unless you can answer the question,
	"Why should I never unlock a file lock?".  #4, again no test of
	the return value of flock().

: close(LOG);

	#5, again no test of the return value of close().  Close() BTW, will
	unlock the lock for you (see above).

: I do not know the reason behind the 2 and 8, but I know that flock(FILE,2);
: begins the flock and flock(FILE,8); ends the flock.

	They are system dependent constants to tell flock() what to do.  You
	should actually be coding something like:

	use Fcntl ':flock';

	flock LOG, LOCK_EX
	    or die "flock: $!";

: My question is if I have two files that need to be written to are both safe
: with flock if I do the following:
	>snip<

	No.

: Or do I need to do this:
	>snip<

	That won't work either.

	>snip<
: Or would one file close as soon as I open another one?

	No. -Unless you use the same handle name, but you don't.

: Can you offer any help on this?

	perldoc -f flock
	perldoc Fcntl
	perldoc -q lock
	man 2 flock

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Wed, 20 Jan 1999 03:59:33 GMT
From: jlatifi@tsicable.com
Subject: Re: How to best process a large CGI form?
Message-Id: <36a55367.17501936@corp.supernews.com>

I guess I was unclear.  I have a large number of text boxes in the
form.  They are named something like a1,a2,a3,b1,b2,....

Can the values of these objects be loaded into an array using a loop?
How? Once I get them in there, I think I'll be ok.  Thanks for your
help.

Eldorado

On 19 Jan 1999 17:09:18 GMT, abigail@fnx.com (Abigail) wrote:

>jlatifi@tsicable.com (jlatifi@tsicable.com) wrote on MCMLXVII September
>MCMXCIII in <URL:news:36a3fd90.19105872@corp.supernews.com>:
>%% I have a large form, (many similar form objects), that I need to put
>%% into arrays.  I will then check for null, and mail away non-null
>%% variables.  How can I do this without explicitly loading each object
>%% into the arrays?
>
>
>You lost me here. You have your "objects" (whatever they are) which
>you need to put into arrays (you don't explain why). Then you ask
>how you can do that without "loading" (?) each object into the arrays.
>
>Could you tell me how I can shovel sand into a wheelbarrow, without
>shoveling sand into a wheelbarrow?
>
>
>
>Abigail
>-- 
>sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
>"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
>*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
>_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))



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

Date: 20 Jan 1999 02:33:44 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: How to get IP address of a local machine under NT
Message-Id: <783fa8$1v5$1@gellyfish.btinternet.com>

On Tue, 19 Jan 1999 16:33:18 -0500 (EST) KernelKlink@webtv.net wrote:
> To do it with Perl (check with an expert first) I think you would use
> the "system" command.
> 

No. That wouldnt be the recommended way to do this at all.

Please refer to FAQ as suggested in my other post.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Tue, 19 Jan 1999 22:16:57 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: MacPerl question
Message-Id: <alecler-1901992216570001@dialup-622.hip.cam.org>

In article <182CBD3DCS86.PETER@yaleads.ycc.yale.edu>,
PETER@yaleads.ycc.yale.edu wrote:

> Hi.  Can someone tell me how to call a MacPerl script from within another
> MacPerl script?

Look up do() in perlfunc.pod.

HTH,
Andre


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

Date: Wed, 20 Jan 1999 02:54:25 GMT
From: scott.craig@moh.hnet.bc.ca
Subject: Re: newbie - endless loop on simple program.
Message-Id: <783ggs$6tv$1@nnrp1.dejanews.com>

In article <7833jc$2dg$1@news.raptor.com>,
  "Robert E. John" <rjohn@raptor.com> wrote:

> The following code fragment produces an endless loop?
>
> $num=0;
> $increment=0.1;
> until ($num == 1.1) {
>   print("$num ");
>   $num = ($num + $increment); #Am I doing something bad here??
>
> } #END OF CODE FRAGMENT

The "bad" thing is testing using ==. It's usually better to use <.

You were right to suspect floating point error. Witness:

$num = 0; $inc = 0.1;
until( $num > 1.05){
    $num += $inc;               ## Same as above
    print  unpack ( B64, pack (d, $num)), " $num\n";
}
print  unpack ( B64, pack (d, 1.1)), " 1.1 really\n";

1001101010011001100110011001100110011001100110011011100100111111 0.1
1001101010011001100110011001100110011001100110011100100100111111 0.2
0011010000110011001100110011001100110011001100111101001100111111 0.3
1001101010011001100110011001100110011001100110011101100100111111 0.4
0000000000000000000000000000000000000000000000001110000000111111 0.5
0011001100110011001100110011001100110011001100111110001100111111 0.6
0110011001100110011001100110011001100110011001101110011000111111 0.7
1001100110011001100110011001100110011001100110011110100100111111 0.8
1100110011001100110011001100110011001100110011001110110000111111 0.9
1111111111111111111111111111111111111111111111111110111100111111 1
1001100110011001100110011001100110011001100110011111000100111111 1.1
1001101010011001100110011001100110011001100110011111000100111111 1.1 really
      ^^   The bit strings differ here.

Regards,
Scott

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


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

Date: Wed, 20 Jan 1999 03:23:30 GMT
From: xiaobei@netcene.com (bei)
Subject: newbie question about tag matching
Message-Id: <36a5468a.323181750@news.giganews.com>

Hi all, I am a newbie to perl, pls forgive me if my question looks
stupid to u. 

I define a style file with some html like tag, such as following

<<OURFONT>>	
<FONT FACE=ICS4>@</FONT>
<</OURFONT>>

<<OURFONT>> and  <</OURFONT>> are my tag and <FONT FACE=ICS4>@</FONT>
is the content. I try to read this style file and store the tag  and
content in two separate arrays, while the ith element of the tag array
corresponding to the ith element of the content array. But I can't do
that with the following code. Pls help me to fix it.

-----------------------------------------------------------------------------------------------------
$oldf = "h.sty";
open (OLDF,$oldf) or die "cannot open old";
@file =<OLDF> ;
close OLDF;
$arrlen = @file;
@content = {""};
@tag = {""};
$mmm = 0;
for $num (0..$arrlen){
	$_ = $file[$num]; 
	if (m/<<(.*)>>/){
		$tag[$mmm] = $1;
	} 
	elsif (m/<</(.*)>>/){
		$mmm++;
	}
	else{
		$content[$mmm] .= $file[$num]; 
	}
	
}
print @tag;
print @content;
-----------------------------------------------------------------------------------------------------

In addition, I need to read another file in which something looks like

OURFONT: Thank you very much!

Then according to the definition of OURFONT in the style file I need
to substitute the '@' with "Thank you very much!" and the final output
would become 

<FONT FACE=ICS4>Thank you very much!</FONT>

Would u pls also tell how to do this.

Bei.



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

Date: Wed, 20 Jan 1999 04:14:13 GMT
From: tybee@my-dejanews.com
Subject: Perl Calendar and Publishing Script...
Message-Id: <783l6m$a2m$1@nnrp2.dejanews.com>

Hiya,

I'm still learning Perl and using it on my website, I have been looking for a
decent Calendar CGI that allows additions, editing, etc. online, anyone have
any suggestions?

Also, I have been trying to find a script that allows you to publish online,
making an html page on the fly as it were and saving it on the server to be
viewed, etc.

Thanks for any input.


Patrick  :)

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


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

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

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