[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

offtopic: perl question about dialog.pl



Hello,

I'm new to perl and want to write a small perl script with a nice
userinterface. There is a wrapperscript for /usr/bin/dialog,
but it gives the following warning:

Use of implicit split to @_ is deprecated at ./dialog.pl line 34.

I'm using potato with perl-5.005.

What is the correct syntax in dialog.pl for split()?

Thanks,
 -- Olaf


I used the following small testscript:
---
#!/usr/bin/perl -w
require "dialog.pl";
&rhs_msgbox("Title","Just a message.",30);
---

Portion of /usr/lib/perl5/dialog.pl:
---
sub rhs_msgbox {
    local ( $title, $message, $width ) = @_;
    local ( $tmp, $height, $message_len );

    $message = &rhs_wordwrap($message, $width);
    $message_len = split(/^/, $message);        # <-- line 34
    $tmp = $message;
    if (chop($tmp) eq "\n") {
        $message_len++;
    }
    $height = 4 + $message_len;

    $tmp = system("dialog --title \"$title\" --msgbox \"$message\"
$height $width");
    if ($tmp) {
        return 0;
    } else {
        return 1;
    }
}
---


Reply to: