in reply to how to get the local variable value outside the box

  1. Please use <code> tags. Without them your code is very hard to read. Fixed now.
  2. To what box do you refer?
  3. I can only guess that this is a scoping problem. Try declaring your variable first.
my $location_id; if ($resp->is_success) { $location_id = $resp->header( 'Location' ); } print $location_id;

Update: Now that the code is legible it is easy to see that you have declared $location_id twice in the same block. If you had used warnings this would have been alerted to you. Don't double-declare.

Replies are listed 'Best First'.
Re^2: how to get the local variable value outside the box
by bhushanQA (Sexton) on Jun 30, 2015 at 10:04 UTC
    Please check now