10 More Discussions You Might Find Interesting
1. AIX
Hi Guys,
When using plink ( plink -ssh $IP) to connect to an AIX box, the password is correct, but always after input the password and click enter I got "access denied", then I am promted for password again, this time no matter what password I give, correct or bad, after I re-click enter, as... (2 Replies)
Discussion started by: kensview
2 Replies
2. Shell Programming and Scripting
the below code will search attr string inside makefile under the modelno on given path.
echo "Enter model no for searching string inside makefile"
read inputs2
#find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \;
#;;I am getting below error.... (7 Replies)
Discussion started by: lathigara
7 Replies
3. Shell Programming and Scripting
Hi, Here is the errors:
Any help will be greatly appreciated! (4 Replies)
Discussion started by: aixlover
4 Replies
4. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
5. Shell Programming and Scripting
This is the script:
#!/bin/sh
if ; then rm -rf /usr/share/WallpaperChanger; fi
if ; then rm -rf /usr/bin/wallch; fi;
if ; then rm -rf /usr/share/applications/wallch.desktop; fi
if ; then rm -rf /usr/share/doc/wallch; fi
if ; then rm -rf /usr/share/man/man1/wallch.1.gz; fi
echo "Delete... (4 Replies)
Discussion started by: hakermania
4 Replies
6. Web Development
I have one syntax to find something from desktop on server, the script is as below, I actually speaking don't know anything in this script.
It creates a window, where i get a drop down boxes with folder names given below and a blank box where i have to put the folder name to search. and then I... (2 Replies)
Discussion started by: patilrakesh1984
2 Replies
7. Infrastructure Monitoring
I am trying to install net-snmp on an HPUX box. I am getting the fallowing error message when I try to run the snmpconf file. I installed the fallowing version of
net-snmp
net-snmp-5.0.10.2-HP-UX_B.11.11_9000_800.tar and my
HPUX box is version
HP-UX commnms B.11.11 U 9000/800... (2 Replies)
Discussion started by: krisarmstrong
2 Replies
8. Shell Programming and Scripting
in "cmd" command i want to copy the ouput of the command excuted to a particular file in a directory.
How to do this..??
Ex : $telnet->cmd(String => 'allip:acl=a1;',Prompt => '/</');
i want to copy o/p of the command "allip:acl=a1;" in a log file in a particular directory.
Plz suggest.. (1 Reply)
Discussion started by: sudhakaryadav
1 Replies
9. Windows & DOS: Issues & Discussions
Hi,
Can anybody help me in writing command "waitfor" for string
"C:\WINNT\Profiles\mfcf0508>" while using net::Telnet module.
I tried the below format :
$telnet->waitfor('/"C\:\WINNT\Profiles\mfcf0508>".*$/i');
Getting error as : pattern match timed-out
Plz help me (3 Replies)
Discussion started by: sudhakaryadav
3 Replies
10. Shell Programming and Scripting
Hi,
Can anybody help me in writing command "waitfor" for string
"C:\WINNT\Profiles\mfcf0508>" while using net::Telnet module.
I tried the below format :
$telnet->waitfor('/"C\:\WINNT\Profiles\mfcf0508>".*$/i');
Getting error as : pattern match timed-out
Plz help me (1 Reply)
Discussion started by: sudhakaryadav
1 Replies
Router::Simple::Cookbook(3pm) User Contributed Perl Documentation Router::Simple::Cookbook(3pm)
NAME
Router::Simple::Cookbook - The Router::Simple Cookbook
FAQ
How to create Sinatra-ish framework with Router::Simple?
Please read the following example code.
package MySinatraish;
use Router::Simple;
use Plack::Request;
sub import {
my $pkg = caller(0);
my $router = Router::Simple->new();
my $any = sub ($$;$) {
my ($pattern, $dest, $opt) = do {
if (@_ == 3) {
my ($methods, $pattern, $code) = @_;
($pattern, {code => $code}, +{method => [ map { uc $_ } @$methods ]});
} else {
my ($pattern, $code) = @_;
($pattern, {code => $code}, +{});
}
};
$router->connect(
$pattern,
$dest,
$opt,
);
};
no strict 'refs';
# any [qw/get post delete/] => '/bye' => sub { ... };
# any '/bye' => sub { ... };
*{"${pkg}::any"} = $any;
*{"${pkg}::get"} = sub {
$any->([qw/GET HEAD/], $_[0], $_[1]);
};
*{"${pkg}::post"} = sub {
$any->([qw/POST/], $_[0], $_[1]);
};
*{"${pkg}::as_psgi_app"} = sub {
return sub {
if (my $p = $router->match($_[0])) {
[200, [], [$p->{code}->()]];
} else {
[404, [], ['not found']];
}
}
};
}
package MyApp;
use MySinatraish;
get '/' => sub {
'top';
};
post '/new' => sub {
'posted';
};
as_psgi_app;
How to switch from HTTPx::Dispatcher?
HTTPx::Dispatcher is class specific declararative router.
package MyApp::Dispatcher;
use HTTPx::Dspatcher;
connect '/', {controller => 'foo', action => 'bar'};
1;
The following script is same as above.
package MyApp::Dispatcher;
use Router::Simple::Declare;
my $router = router {
connect '/', {controller => 'foo', action => 'bar'};
};
sub match { $router->match() }
How to use Router::Simple with non-strictly-MVC application?
use Router::Simple::Declare;
my $router = router {
connect '/foo/bar/' => { 'target' => '/foobar.asp' };
connect '/topics/:topic' => { target => '/my-topic.asp' };
connect '/products/{Category:.*}' => { target => '/products.asp', Category => 'All' };
connect '/zipcode/{zip:[0-9]{5,5}}' => {target => '/zipcode.asp' };
};
You can pass the target path as destination.
AUTHOR
Tokuhiro Matsuno <tokuhirom AAJKLFJEF GMAIL COM>
LICENSE
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Router::Simple
perl v5.14.2 2011-05-15 Router::Simple::Cookbook(3pm)