in reply to lwp::simple basic question about webbing
The scalar is probably better to assign a blob of text info to. With the || operator, your variable is guaranteed to at least contain something-- if not the HTML, then an error message (since if get fails, it returns undefined). With the "die" message, your program stops altogether with an informative message-- probably better unless dying is not at all an option.my $a = get( $url ) || "get $url failed"; or my $a = get( $url ) or die "Couldn't get() $url: $!";
|
|---|