Re: Strange use of => ?

2012-05-11 Thread Jim Gibson
On May 11, 2012, at 7:39 PM, Owen wrote: > I found this on the internet to convert an IPv4 address (w.x.y.z) to > a decimal number. > > w * 16,777,216 + x * 65,536 + y * 256 + z = decimalNumber > > I then found the subroutine, ip2dec in the script below. > > The script works, that's not my pro

Strange use of => ?

2012-05-11 Thread Owen
I found this on the internet to convert an IPv4 address (w.x.y.z) to a decimal number. w * 16,777,216 + x * 65,536 + y * 256 + z = decimalNumber I then found the subroutine, ip2dec in the script below. The script works, that's not my problem. The problem is "How does it work"? The "split /\./"

Re: CGI setuid programs

2012-05-11 Thread David Christensen
On 05/11/2012 01:25 PM, Tessio Fechine wrote: Everywhere I read about cgi setuid programs says that it is wrong and must never be done, but nobody says how to circumvent the need of it. In my case, I need to read a password from a protected file (read only, owned by root) to connect to a database

CGI setuid programs

2012-05-11 Thread Tessio Fechine
Hello, Everywhere I read about cgi setuid programs says that it is wrong and must never be done, but nobody says how to circumvent the need of it. In my case, I need to read a password from a protected file (read only, owned by root) to connect to a database. How can I do this without running setui

Re: Change relative path to absolute path

2012-05-11 Thread Magnus Woldrich
On May 11, Zapp (Zapp) wrote: Does anyone has a better idea? #!/usr/bin/perl use strict; use warnings FATAL => 'all'; use Cwd qw(getcwd); my $cwd = getcwd(); print map { -e "$cwd/$_" ? "$cwd/$_\n" : "$_\n" } @ARGV; Or use rel2abs in the core File::Spec module. -- Magnus Woldrich

Re: Change relative path to absolute path

2012-05-11 Thread Shawn H Corey
On 12-05-11 05:14 AM, Zapp wrote: > Does anyone has a better idea? Yes, use Cwd::realpath() See `perldoc Cwd` for details. -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. [updated for today's programming]

Change relative path to absolute path

2012-05-11 Thread Zapp
I have a path like "/root/Tools/Log/../../Bin2/Patch/../Settings/ServerInfo/", and it's absolute path should be "/root/Bin2/Settings/ServerInfo". and I use these codes to get what I want. my $my_str = "/root/Tools/Log/../../Bin2/Patch/../Settings/ServerInfo/"; Replace_it: $my_str =~ s#[^\./]+/\.\.