Open Source · TechIt

Sed and Print in Perl

I recently needed a sed-like script for a web based perl app doing to internally convert request ports and came across some interesting print code in the process of testing it


#!/usr/bin/perl

sub println
{
$\ = "\n";
@_ = ($_) unless @_;
print @_;
}

 

my $sec = "https://dmom.domain.com:633/confirm/me/";
$sec =~ s/:633/:81/;
println $sec;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s