[ORACLE] [SQLSERVER] [POSTGRES] [MYSQL] [DBA] [UNIX] [LINUX] [WINDOWS] [FREEBSD] [REDHAT] [SQL] [PERL] [SH] [BAT] [SCRIPT]
Tuesday, March 27, 2012
Friday, March 23, 2012
Tuesday, March 13, 2012
Perl - Sub/Hash
#!/usr/bin/perl
use strict;
use warnings;
my %hash;
$hash{'perl'} = ' =) ';
&show(\%hash);
sub show(){
my ($hash) = @_;
foreach my $key (keys %hash){
print "$hash->{$key}";
}
}
Result :
$perl blog.pl
=)
Friday, March 9, 2012
Perl - Function Substr
#!/usr/bin/perl
use strict;
use warnings;
my $phrase = 'This is friend "command line"';
my $friend = substr($phrase,16,12);
print "$friend\n";
my $this = substr($phrase,0,4);
print "$this\n";
result:
> perl blog.pl
command line
This
use strict;
use warnings;
my $phrase = 'This is friend "command line"';
my $friend = substr($phrase,16,12);
print "$friend\n";
my $this = substr($phrase,0,4);
print "$this\n";
> perl blog.pl
command line
This