Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Perl's ":" character in a file.

0 views
Skip to first unread message

Paul Cartier

unread,
Jul 9, 1996, 3:00:00 AM7/9/96
to

Using Perl,

Can someone tell me what syntax is needed to
write out this line in a file: http://www.youraddress.com

When I view the contents of the file, the resulting
address looks like this: http //www.youraddress.com

It seems the ":" character is something special?


Thanks to all that reply

Paul Cartier
pcar...@ix.netcom.com

Jeremy Zawodny

unread,
Jul 9, 1996, 3:00:00 AM7/9/96
to Paul Cartier

On Tue, 9 Jul 1996, Paul Cartier wrote:

> Using Perl,
>
> Can someone tell me what syntax is needed to
> write out this line in a file: http://www.youraddress.com
>
> When I view the contents of the file, the resulting
> address looks like this: http //www.youraddress.com
>
> It seems the ":" character is something special?

Gee, I don't suppose you've tried escaping the ":" character.

BTW, why did you post this to a Web-related newsgroup? Your question is
a Perl question--it belongs in comp.lang.perl.misc. That's it.

Jeremy
--
Jeremy Zawodny
MaraWeb Development
Information Technology Services
Marathon Oil Company, Findlay Ohio


Neville Dastur

unread,
Jul 10, 1996, 3:00:00 AM7/10/96
to Paul Cartier, Netsc...@future2000.co.uk

Paul Cartier wrote:
>
> Using Perl,
>
> Can someone tell me what syntax is needed to
> write out this line in a file: http://www.youraddress.com
>
> When I view the contents of the file, the resulting
> address looks like this: http //www.youraddress.com
>
> It seems the ":" character is something special?Try putting a \ in front of it to escape it. However, it should work without
that. Assuming your're using perl try:

print FILEHANDLE "http://www.youraddress.com";

--
|========================= F U T U R E 2 0 0 0 ========================|
| Have your Web Authoring, design and CGI scripting done by Future 2000 |
| FREEPOST Pinner Middx HA5 4BR UK |
| Tel: +44 (0)181 428 1847 Fax: +44 (0)181 421 3662 |
| >>> Also check out our FREE classifieds at <<< |
| <URL:http://www.future2000.co.uk/classified/index.html> |
|=======================================================================|

I R A Aggie

unread,
Jul 10, 1996, 3:00:00 AM7/10/96
to

In article
<Pine.SUN.3.91.960709...@houinet1.hou.moc.com>, Jeremy
Zawodny <zaw...@houinet1.hou.moc.com> wrote:

+ On Tue, 9 Jul 1996, Paul Cartier wrote:
+
+ > Using Perl,
+ >
+ > Can someone tell me what syntax is needed to
+ > write out this line in a file: http://www.youraddress.com
+ >
+ > When I view the contents of the file, the resulting
+ > address looks like this: http //www.youraddress.com
+ >
+ > It seems the ":" character is something special?
+
+ Gee, I don't suppose you've tried escaping the ":" character.

Well, this seems to be unclear to me. I didn't think the ":"
was a special character, and doesn't need escaping:

[perl5 snippet]

$a="http://www.youraddress.com";
$b='http://www.youraddress.com';
print "http://www.youraddress.com\n";
print "$a\n";
print "$b\n";

[output:]

http://www.youraddress.com
http://www.youraddress.com
http://www.youraddress.com

Gosh, looks like the ":" is printing OK. I suppose the original
poster could be getting some interaction with the "/", which
happens to be the match, substitute, and tr default delimiter and
should be escaped to be safe.

xposted (and followups set) to c.l.p.m.

James

--
#!/bin/perl -s-- -export-a-crypto-system-sig -RSA-3-lines-PERL
$m=unpack(H.$w,$m."\0"x$w),$_=`echo "16do$w 2+4Oi0$d*-^1[d2%Sa
2/d0<X+d*La1=z\U$n%0]SX$k"[$m*]\EszlXx++p|dc`,s/^.|\W//g,print
pack('H*',$_)while read(STDIN,$m,($w=2*$d-1+length($n)&~1)/2)


0 new messages