im having an issue with bulk adding categories, it works fine, except one thing, when i add categories with child, it will only show if i edit the parent category from the categories page, and save, then the child cats show up.

format can be

Finance/Mutual Funds
Finance/Personal Finance
Finance/Real Estate

here is the code

Code:
<?php
add_action('admin_menu', 'bulk_cat_menu');
function bulk_cat_menu() {
    add_management_page('Category Import', 'Category Import', 10, __FILE__, 'bulk_add_cat');
}
function bulk_add_cat() {
    global $wpdb;
    $cats = $_POST['bulk_category_list'];
    $s = split("\n", $cats);
    foreach($s as $cat){
        $cat = trim(preg_replace("![\r\n]+!", '', $cat));
        $cats = split('\/', $cat);
        $last_id = 0;
        foreach($cats as $c2){
            $last_id = wp_create_category($c2, $last_id);
        }
    }
?>
<div class="wrap nosubsub">
    <div class="icon32" id="icon-edit"><br/></div>
    <h2>Bulk Category Import</h2>
    <form name="bulk_categories" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>" method="post">
        <br/>
        <strong>Enter a list of category names, one per line:</strong>
        <br/>
        <textarea name="bulk_category_list" rows="20" style="width: 99%;"></textarea>
        <br/>
        <p class="submit"><input type="submit" name="submit" value="Add categories"/></p>
    </form>
</div>
<?php
}
?>