what does perl operator “||=” do?

后端 未结 4 1357
逝去的感伤
逝去的感伤 2021-01-29 12:32

What does the operator ||= do in perl?

to be more specific if you have a code like:

my ($my_link);
$my_link  ||= DownloadF($file,\'l\') if          


        
4条回答
  •  青春惊慌失措
    2021-01-29 13:10

    it means if $my_link is nil/has no value, then assign it this value with = (value)

    if $my_link already has a value, then it don't do anything

提交回复
热议问题