Perl Forum for Beginners

How to do absolute redirect in perl

Jun 2, 2011 9:45 am
Anujbhambhani

$Request->redirect( url => $Std->url("/gp/errors/404"),type =>
"permanent");
works for me
but
$Request->redirect( url => $Std->url("http://www.google.com",
{absolute => 1});
does not work someone please help

Jun 3, 2011 1:48 am
Peter Scott
Re: how to do absolute redirect in perl

On Thu, 02 Jun 2011 02:45:25 -0700, anujbhambhani wrote:

> $Request->redirect( url => $Std->url("/gp/errors/404"),type =>
> "permanent");
> works for me
> but
> $Request->redirect( url => $Std->url("http://www.google.com",
> {absolute => 1});
> does not work someone please help

Please provide a complete script of under 20 lines that we can run, tell
us what output you see from running it, and what output you think you
should see instead.



Previous Thread: Parsing file
Next Thread: Parsing file

Related Forum Topics
Cgi and absolute filenames
This may belong somewhere else... but I'm pretty sure someone here can
tell me about this.

When using cgi to run scripts over html, what is the right addressing
scheme when the script needs to open or alter files on the server.

For example... a cgi writes a page for viewing.

the cgi...
Shell outpur redirect, perl input issue linux
--=_alternative 0065DEAE852574B2_=
Content-Type: text/plain; charset="US-ASCII"

I have the following command that redirects output from the script to
temp.txt.

system "ssh -x -t $_ \"sudo /home/tadipah/test.sh\" > temp.txt ";

If I open the file temp.txt, I can see one word "jboss"; I...
Mechanize Redirect
Have seen this issue addressed on this board in the past, but can't
figure out exactly what I need to do.

I'm using WWW::Mechanize and a webpage seems to be redirecting me but
Mechanize doesn't seem to follow it. I've heard to "Add the header
'Accept: text/html'" but alas I don't know how...
Redirect option
------=_Part_44916_7283763.1224155953729
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Is there any option to redirect a URL in perl other than Location ?

Regards

Sheela

------=_Part_44916_7283763.1224155953729--


Redirect STDERR


I have these lines in my script:

**************************************
for my $handle (*STDIN, *STDERR) {
open($handle, "+</dev/null") or die "$me: Can't reopen $handle to
/dev/null: $!. Exiting.\n";
}

# open outfile for further recording
open(STDOUT,">$outfile") or...
Change relative path to absolute path
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 =~...
Redirect Find::File to /dev/null
I'm using Find::File in my program. Unfortunately I get the ugly
'Permission denied' output that I'd normally redirect to /dev/null if
I was using bash.

Here is the command I used to generate the Find::File code:
$ find2perl /usr -name libaest.dylib -print

I saved that to a new file and...
How to redirect in system command two devices at once
Hello,

I am calling system() to run a devenv.exe to build vs 2005 solution
file.
My problem is I want to capture the output while building the solution
to a file and show the output to monitor at once.

Is there a way or a module to achieve that goal?

TIA



Redirect system command STDER
--0050450176cca585b404a870ebf6
Content-Type: text/plain; charset=ISO-8859-1

Hello,
I have a subroutine that uses useradd to create accounts

--
@cmd = ('useradd', '-m', $account);
my $result = system @cmd;
--

but when useradd fails, I need to stop it from sending the error message...
Fw: redirect system command STDER
--MP_/EJc=o=nssaHEUpCE=GFS72g
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,

we keep receiving these messages when posting to beginners@perl.org. Can you
please unsubscribe lellis@claimspages.com from...